Re: Direct Access to an Array Item?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peter Beckman wrote:
>     if (($row = mysql_fetch_row($result))[3] == 'foo') {
>         $user = $row;
>     }
> 
> or
> 
>     $bar = explode('#', $str)[2];

PHP does not currently support this type of syntax in any form. You must
assign the return value of a function to a variable if you want to
access it as an array.

-Stut

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux