On Wednesday, June 26, 2002, at 01:04  PM, Lee P Reilly wrote:

> Can someone tell me if it's possible to create variable names from
> varaible names? I could work around this problem using some if/else
> statements, but I'm interested to see if there's another solution.

Just try it.

for ($i = 0; $i < 10; $i++) {
        $var{$i} = $i + 6;
        echo "\$var$i == " . $var$i . "\n";
}

$var0 = 6
$var1 = 7
$var2 = 8
$var3 = 9
$var4 = 10
$var5 = 11
$var6 = 12
$var7 = 13
$var8 = 14
$var9 = 15


Erik



----

Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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

Reply via email to