Re: Syntax ::: does explode('-', $string)[2] ::: have a twin brother?

From: Date: Tue, 19 Dec 2000 06:14:42 +0000
Subject: Re: Syntax ::: does explode('-', $string)[2] ::: have a twin brother?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30998@lists.php.net to get a copy of this message
At 12:26 PM 12/19/2000 +0900, Maxim Maletsky wrote:
Did I see it somewhere or I dreamed it off my tired mind?
I use it in Perl all the time!
I was wondering if there is a way to say this: $to = explode('-', $string); $to = $to[2];
Here's a different approach: list ( $hell , $hell , $to ) = explode ( '-' , $string ); PHP could use something like Perl's versatile 'undef' function/op. Enjoy! Faisal

« previous php.general (#30998) next »