list

It assigns variables as if they were an array

Example

<?php
echo “<pre>”;
$lan = array(“PHP”,”ASP”,”JSP”);
list($lan1, $lan2, $lan3) = $lan;
echo $lan1.”<br>”;
echo $lan2.”<br>”;
echo $lan3.”<br>”;
?>

Output

PHP
ASP
JSP

Share