RE: [PHP] Perl style
| From: | Jay Blanchard | Date: | Wed, 26 Oct 2005 13:54:54 +0000 |
| Subject: | RE: [PHP] Perl style | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224675@lists.php.net to get a copy of this message | ||
[snip]
$tmparray = split(',', $csvstring);
$element5 = $tmparray[5];
. to something like this:
$element5 = (split(',', $csvstring))[5];
[/snip]
The syntax is correct in your first example, AFAIK the PERL syntax you
describe cannot be done straight up in PHP unless you write a function to
handle it. You could always write a PHP extension.