Home > Backend Development > PHP Tutorial > PHP list() function_PHP tutorial

PHP list() function_PHP tutorial

WBOY
Release: 2016-07-13 17:44:27
Original
816 people have browsed it

$my_array = array("Dog","Cat","Horse");

list($a, $b, $c) = $my_array;
echo "I have several animals, a $a, a $b and a $c.";
?>
输出:

I have several animals, a Dog, a Cat and a Horse.
例子 2
$my_array = array("Dog","Cat","Horse");

list($a, , $c) = $my_array;
echo "Here I only use the $a and $c variables.";
?>
输出:

Here I only use the Dog and Horse variables.

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478745.htmlTechArticle?php $my_array = array("Dog","Cat","Horse"); list($a, $b, $c) = $my_array; echo "I have several animals, a $a, a $b and a $c."; ? 输出: I have several animals, a Dog, a Cat and...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template