When you write in PHP $$name, parser treats it as variable, wchich name is value of $name – it works like pointer:
<? $var1 = 'test1'; $var2 = 'test2'; $a = 'var1'; echo $$a.'<br>'; $a = 'var2'; echo $$a; ?>
output:
test1 test2
Wojciech Jamrozy blogBlog about computer science, programming and linux
|
When you write in PHP $$name, parser treats it as variable, wchich name is value of $name – it works like pointer:
<? $var1 = 'test1'; $var2 = 'test2'; $a = 'var1'; echo $$a.'<br>'; $a = 'var2'; echo $$a; ?>
output:
test1 test2