I'm trying to loop through foreach with an array populated in JSON. To facilitate I'm testing via $ _GET (but I already tested with array populated by php itself but did not work). $ _GET looks like this:
$amigos = json_decode($_GET['amigos']);
The foreach looks like this:
foreach ($amigos as $a)
And the data passed via $ _GET looks like this:
[{'nome':'bruno','email':'[email protected]'}]
I always get the error message:
Invalid argument supplied for foreach()
I do not understand why this happens .. Any ideas?
att