Trying to be elegant...

From: Date: Sun, 05 Mar 2000 20:56:20 +0000
Subject: Trying to be elegant...
Groups: php.version4 
Request: Send a blank email to php-version4+get-11538@lists.php.net to get a copy of this message
In the "elegant spirit of Perl", I tried to use the following code in PHP: ---- while (list(,$val) = each(array("a", "b", "c"))) { print "$val<BR>\n"; } ---- It didn't work. I had to assign the array to a variable and pass the variable to each(). Is there a way to write this in a more elegant, "Perl spirit" way in PHP? (This is obviously not a matter of high technical importance, but one of artistic and poetic freedom :-) Very best regards, /Johan Ekenberg

« previous php.version4 (#11538) next »