PabloVallejo
7/25/2013 - 8:16 PM

Multiple assignment in PHP

Multiple assignment in PHP

<?php


// Multiple assignment
//--------------------


// Directly 
list( $a, $b, $c ) = array( 1, 2, 3 );

// Using previeusly defined array
$arr = array( 1, 2, 3 );
list( $a, $b, $c ) = $arr;

?>