You are here: How to make a variable named after the value of another variable? « PHP Language « IT news, forums, messages
How to make a variable named after the value of another variable?

Posted by <talthen.z-serwera.o2 on 08/23/05 18:11

Hello,
How to make a variable named after the value of another variable?

I know I can use smth like:

$a="name";

$$a="hey";

and that will produce variable called $name with value "hey". But when I try
something like:


$a="_REQUEST['";
$b="']";
$c=$a."thename".$b;
$$c="thevalue";
echo $c;
foreach ($_REQUEST AS $key=>$val)
echo "$key: $val\n"

Then I have only a printout:

_REQUEST['thename']


How to make this _REQUEST['thename'] a variable name?

Ragards,

Talthen

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация