Hi ... You can make it like this:

If you have 
$variable4[0]="four";

Then you can have a new variable

$$variable[0] , and the new variable´s name is four


Cordialmente

Daniel Massón => Ingeniero de desarollo

[EMAIL PROTECTED]

www.imagine.com.co

Tels: (57)(1) 2182064 - 6163218

Bogotá - Colombia

------------------------------------------------------------------------

- Soluciones web para internet e intranet

- Asesoría y Soporte Técnico

- Licenciamiento de Software 



-----Mensaje original-----
De: Kevin Heflin [mailto:[EMAIL PROTECTED]] 
Enviado el: viernes, 06 de septiembre de 2002 13:38
Para: php-general
Asunto: [PHP] generating variable names


Hoping someone can help me with this. Below I have an example of what 
I'm trying to accomplish.
Bottom line.. I need to print out $variable3[0] and $variable4[0] and my
problem is that I'm trying to generate the variable name. I can 
get this to work with $variable1 and $variable2 which are not arrays, 
however that doesn't help me much.

Any suggestions would be appreciated.

Kevin



<?
        $variable1="one";
        $variable2="two";
        $variable3[0]="three";
        $variable4[0]="four";
        
        $j=1;
        while($j<5){
                print("${variable.$j} <BR>");
                $j++;
        }


        $j=1;
        while($j<5){
                $k="\$variable".$j."[0]";
                print("$k <BR>");
                print("${variable.$k} <BR>");
                $j++;
        }
?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to