PHP Tutorial : List function
Jun 16, 2009 Useful PHP
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 ?>
Tags: assign variables, list, php convert string into variable, php list, php list function


June 16th, 2009 at 12:23 am
[...] the original post here: PHP Tutorial : List function Posted in PHP | Tags: called-list, function-will, list, one-variable, php-function, [...]
June 16th, 2009 at 12:24 pm
[...] more from the original source: » PHP Tutorial : List function Tags: change-the-light, color, easy, entries, final-step, follow-the-steps, know-layers, lcd, [...]