Mega Code Archive

 
Categories / Php / Data Type
 

Assign elements from array to variables

<?php  $scores = array(88, 75);  @list($maths, $english, $history) = $scores;  @printf("<p>Maths: %d; English: %d; History: %d; Biology: %d.</p>\n", $maths, $english, $history, $biology);  ?>