PHP echo user name (YouTube)


I’m trying to pull the users name from the YouTube chat box when a custom channel command has been given.
The custom command !test triggers the call below.


On I have (I know not really secure as is, but it’s just a test) the following code.

echo "Hello " . $_GET['user'];

This is working fine EXCEPT when the username has a & (ampersand) in it.
ie: If the name is me & you it will only echo back me

Anyone here who might know how to fix this?


Use $(querystring) to ensure the name given in $(touser) is always properly sent to your API:

$(urlfetch$(querystring $(touser)))
1 Like

That did the trick. Thank you @RokettoJanpu RokettoJanpu

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.