| Previous | Home | Next |
array_list()
The list() function is used to assign only numeric values to a list of variables in one operation.
Syntax:list(var1,var2...)
In above syntax, "var1" is used to assign a value to, "var2,..." is useto assign values to more variables.
Example:
<?php
$my_vehicle = array("Car","Scooter","Motorcycle");
list($a, $b, $c) = $my_vehicle;
echo "I have many vehicles; a $a, a $b and a $c.";
?>
Output:
| Previous | Home | Next |