Wednesday 15th August 2007by Mr Me
PHP Simple Swap >>
You know list function in php and array function. Just
type like below for swapping two variables $a and $b.
|list($b,$a) = array($a,$b);|
The above code is equivalent to:
$temp = $a;
$a = $b ;
Here we shorten the three line of code into a single line.