Solved

variable variables

Posted on 2003-10-21
2
187 Views
Last Modified: 2006-11-17
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
Comment
Question by:dnamroud
2 Comments
 
LVL 13

Accepted Solution

by:
lozloz earned 50 total points
ID: 9595075
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
 

Author Comment

by:dnamroud
ID: 9596065
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now