PHP list array


 

PHP list array

In this segment of the tutorial we will learn about the function list in context of list . And also we will see the example related to the list function

In this segment of the tutorial we will learn about the function list in context of list . And also we will see the example related to the list function

Syntax for PHP List Array
void list(var arg1,var arg2,var arg3)

  • list() is used to assign many variables at a time.
  • It takes variable values from the array and assign it to the variables of the list.


Example of PHP List Array

Code for PHP List Array
<?php

    $stud
= array(1 ,'jack', 'math');
     list
($roll, $name, $subject) = $stud;
     echo
"roll is $roll<br>name is $name<br>subject is $subject";
?>

Output
roll is 1
name is jack
subject is math

Ads