• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

variable variables

Hello,

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

Dany Namroud
0
dnamroud
Asked:
dnamroud
1 Solution
 
lozlozCommented:
hi,

$_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
0
 
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}.

http://ca3.php.net/variables.variable
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now