Solved

variable variables

Posted on 2003-10-21
2
188 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

815 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

10 Experts available now in Live!

Get 1:1 Help Now