rename variables
| From: | Boyd Pearson | Date: | Wed, 24 Sep 2003 20:32:17 +0000 |
| Subject: | rename variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-163812@lists.php.net to get a copy of this message | ||
I'm trying to rename some variables.
first I have a function -
randomize (3,4); //has created unique $numbers
then I want to create a function for the renaming:
renameit($sculp); //sends $sculp for the new variable name
and this function (and variations)
function renameit($var){
$z = 1;
foreach ($numbers as $currNum){
$var[$z++] = $output[$currNum]; //creates $sculp[1 and 2]
}
}
but failed
if I use
$z = 1;
foreach ($numbers as $currNum){
$sculp[$z++] = $output[$currNum];
after randomize (3,4);
it works fine -but I want it in a function.
Any suggestions?
*************************************************
The Eldritch Dark:
Dedicated to Clark Ashton Smith:
http://www.eldritchdark.com/