[UPHPU] Accessing an element in an array returned from a function

thebigdog bigdog at venticon.com
Thu Jan 29 14:39:12 MST 2009


Richard K Miller wrote:
> If abc() returns an array, is there any possible notation that lets me 
> access a single element?
> 
>     echo abc()[0];   // I wish this were possible
> 
> ...instead of having to use an intermediate variable?
> 
>     $temp = abc();   // $temp is ugly
>     echo $temp[0];

echo current(abc());


-- 
thebigdog


More information about the UPHPU mailing list