variable variables


I know that we can't use this variable: ${$_GET}, but what is the solution to get the same result
thank you

Dany Namroud
Who is Participating?
lozlozConnect With a Mentor Commented:

$_GET doesn't have a value as it's an array, but if you wanted to access each index in the array, you'd probably need something like:

foreach($_GET as $k => $v) {
  $k = $v;

otherwise you need something like ${$_GET["variable"]} = "blah"; i'm not sure if that's what you're after though
dnamroudAuthor Commented:
Thank you very much

i was confused with the information posted ont he PHP site:
Please note that variable variables cannot be used with PHP's Superglobal arrays. This means you cannot do things like ${$_GET}.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.