note 90051 added to ref.array
| From: | Anonymous at osu1 dot php dot net | Date: | Fri, 03 Apr 2009 09:41:52 +0000 |
| Subject: | note 90051 added to ref.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152783@lists.php.net to get a copy of this message | ||
I need to obtain this simple stylish-result:
<?php
function dummy( )
{
return array( 1, 2, 3 );
}
echo dummy( )[ 1 ]; // DON'T WORK?
?>
So what is the "compress"/"inline" syntax to access
array element without having to assingn function return
to a variable ( $foo = dummy(); echo $foo[1]; )
Help needed :)
----
Server IP: 213.92.11.19
Probable Submitter: 212.239.120.113
----
Manual Page -- http://www.php.net/manual/en/ref.array.php
Edit -- https://master.php.net/note/edit/90051
Del: integrated -- https://master.php.net/note/delete/90051/integrated
Del: useless -- https://master.php.net/note/delete/90051/useless
Del: bad code -- https://master.php.net/note/delete/90051/bad+code
Del: spam -- https://master.php.net/note/delete/90051/spam
Del: non-english -- https://master.php.net/note/delete/90051/non-english
Del: in docs -- https://master.php.net/note/delete/90051/in+docs
Del: other reasons-- https://master.php.net/note/delete/90051
Reject -- https://master.php.net/note/reject/90051
Search -- https://master.php.net/manage/user-notes.php