Perl-Like Pre-Destined Array Designation
| From: | Adam Voigt | Date: | Wed, 23 Oct 2002 12:42:30 +0000 |
| Subject: | Perl-Like Pre-Destined Array Designation | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-89987@lists.php.net to get a copy of this message | ||
Ok, the other day a friend of mine showed me where you
could address a position in an array in perl, before you
even had the array returned. Essentially it would be
this in php:
echo explode(",",$somearray)[0];
Which would give you the first position of what was returned
from the explode function without having to set it to a variable.
I know PHP doesn't support this, but my question is, are you
going to add it? I just ask because I have seen several cases
were I would have liked that ability but wasn't able to.
Adam Voigt
adam.voigt@cryptocomm.com
P.S. Thanks for PHP by the way, I hesitate to think about programming
without it.