note 8851 added to array_keys
| From: | jbatista at iupui dot edu | Date: | Mon, 02 Oct 2000 00:44:14 +0000 |
| Subject: | note 8851 added to array_keys | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-5809@lists.php.net to get a copy of this message | ||
The following does not work...
echo array_keys($anArray)[0];
Although it would be very clean and convenient if that didn't generate a syntax error, it is
necessary to do something like...
$keys=array_keys($anArray);
echo $keys[0];
-Jose Batista
http://www.php.net/manual/function.array-keys.php