Posted by Rik on 01/10/07 01:08
J.O. Aho wrote:
> /* here we create the variable name */
> $variabletouse="var_$i";
> /* here we copy the contents of the variable to a temp variable */
> $temp= $$variabletouse;
> /* here we can pick out the value */
> echo $temp[$pos]; //should give six
>>
Well, extremely shorter:
echo ${'var_'.$i}[$pos];
Still, arrays are better offcourse.
--
Rik Wasmus
Navigation:
[Reply to this message]
|