Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Variable Variables Question

$
0
0

Hi Everybody, I'm trying to simulate a "register globals = ON" environment with this:

 

foreach($_POST as $var=>$value){

${$var} = $value;

}

 

I just noticed that I can use the bracket-less "$$var = $value"  instead of "${$var} = $value." Did I just discover something really cool and easier to type? Or are there horrible pitfalls to the bracketless $$var. I wonder which is faster?

 

Sorry for asking such a basic (dumbo-style) question, but I couldn't google the answer because google strips out dollarsigns and brackets from my search LOL


Viewing all articles
Browse latest Browse all 13200

Trending Articles