Re: Creating a variable from a value

From: Date: Sat, 30 Dec 2000 05:09:16 +0000
Subject: Re: Creating a variable from a value
Groups: php.general 
Request: Send a blank email to php-general+get-32404@lists.php.net to get a copy of this message
You should have a look at the PHP manual, variables section and look at variable variables. that's what you need. or maybe eval(), though variable variables is a better option i guess. --- Rob Curts <rob@siliconcarne.net> wrote: > This may seem strange... hopefully I can explain the > problem well: > I have a variable named $myVar > > $myVar contains a string that may look like > anything, for example, we'll > use "TEST" > > I want to take the string value of $myVar and make a > variable out of it's > value. > > A code example would be this: > > <? > unset($TEST); > > $myVar = "TEST"; > > createNewVariable($myVar); > > if (isset($TEST)) { > // success > else > // error > ?> > > Any idea on how i would create this? > > Many thanks in advance, > Rob > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > For additional commands, e-mail: > php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > ===== To Find Out More About Me : http://mukul.tsx.org/ __________________________________________________ Do You Yahoo!? Yahoo! Photos - Share your holiday photos online! http://photos.yahoo.com/

« previous php.general (#32404) next »