Re: Direct Access to an Array Item?

From: Date: Thu, 10 Aug 2006 00:33:28 +0000
Subject: Re: Direct Access to an Array Item?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-42283@lists.php.net to get a copy of this message
Closest you might get is if ( mysql_result($result,0,3 ) == 'foo') {
       $user = $mysql_fetch_row($result);
} bastien
From: Stut <stuttle@gmail.com> To: Peter Beckman <beckman@purplecow.com> CC: PHP-DB Mailing List <php-db@lists.php.net> Subject: Re: [PHP-DB] 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


« previous php.db (#42283) next »