Create $var with some function

From: Date: Thu, 22 Jan 2009 12:45:18 +0000
Subject: Create $var with some function
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-286997@lists.php.net to get a copy of this message
Hi there, Someone know if can (if possible, how) i create a $var on my script like this: function createvar($var) { $var = 'foo'; global $var; //or global $$var, i don't know it yet. } so i'd call, createvar('myvar'); so i'd could call $myvar, like this: echo $myvar; // prints 'foo' is it possible?

« previous php.general (#286997) next »