Beeing surprised that I didn’t write here about this “cute” php function called list(). I like it a lot, it’s like the extract() function in some way if you remember.
The list() php function will assign variables in one shot to strings from arrays.
<?php //here's the php array $countingArray = array(1,2,3); //here, the list function will convert 1 to $one variable, 2 to $two and 3 to $three list("one", "two", "three") = $countingArray; print "I am counting $one, errr I think it comes $two, and lastly $three"; //should print I am counting 1, err....comes 2 and lastly 3 ?>
Pingback: XkiD | PHP Tutorial : List function | blog.xkid.ro
Pingback: ยป PHP Tutorial : List function- Suwarto Dot Com