Skip to content
Advertisement

I cannot echo the first index of a PHP cURL response

I’m using this little PHP function that I wrote to make calls to my master database:

JavaScript

On register.php I use the following to respond:

JavaScript

My problem comes when trying to retrieve the first index of any given response. I can use var_dump($information) and will receive array(3) { ["test1"]=> string(6) "value1" ["test2"]=> string(6) "value2" ["test3"]=> string(6) "value3" }. However, when I try to echo $information['test1'], I receive this: Notice: Undefined index: test1 in....

Echoing anything other than the first index doesn’t give me this problem.

Does anyone have any thoughts?

Advertisement

Answer

parse_str return type is void

Update your code

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement