Solved

variable variables

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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.

747 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

14 Experts available now in Live!

Get 1:1 Help Now