PHP Programing language

array_list() Function in PHP
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:

I have many vehicles; a Car, a Scooter and a Motorcycle.

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: