Re: Direct Access to an Array Item?

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

 



Closest you might get is
if ( mysql_result($result,0,3 ) == 'foo') {
       $user = $mysql_fetch_row($result);

 }

bastien

From: Stut <stuttle@xxxxxxxxx>
To: Peter Beckman <beckman@xxxxxxxxxxxxx>
CC: PHP-DB Mailing List <php-db@xxxxxxxxxxxxx>
Subject: Re:  Direct Access to an Array Item?
Date: Thu, 10 Aug 2006 00:33:15 +0100

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


--
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