Re: [PHP] Create $var with some function

2009-01-22 Thread Richard Heyes
Hi, function createvar($name, $value) { $GLOBALS[$name] = $value; } Or do it without a function: $GLOBALS['name'] = $value; -- Richard Heyes HTML5 Graphing for Firefox, Chrome, Opera and Safari: http://www.rgraph.org (Updated January 17th) -- PHP General Mailing List (http://www.php.net

RES: [PHP] Create $var with some function

2009-01-22 Thread Jônatas Zechim
No, that's not the point yet. -Mensagem original- De: Robert Stankiewicz [mailto:robe...@belfabriek.nl] Enviada em: quinta-feira, 22 de janeiro de 2009 10:49 Para: Jônatas Zechim; php-general@lists.php.net Assunto: Re: [PHP] Create $var with some function > function c

Re: [PHP] Create $var with some function

2009-01-22 Thread Robert Stankiewicz
function createvar($var) { ${$var} = 'foo'; global ${$var}; //or global $$var, i don't know it yet. } This should work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Create $var with some function

2009-01-22 Thread Jônatas Zechim
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