|
Posted by gosha bine on 06/15/07 20:13
Ciaran wrote:
> Can someone please give me a hand with this?
>
> $arr=array(2,4,5,6);
>
> $test='arr';
>
> echo (eval("$".$test."[0]"));
>
> I'm trying to get it to echo 2
>
> Thanks a lot,
> Ciarán
>
$arr=array(2,4,5,6);
$test='arr';
echo ${$test}[0];
no need of eval.
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
[Back to original message]
|