好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

本篇文章是对php中的list()函数进行了详细的分析

list() ( PHP 4中, PHP 5中) list-指定变量,好象他们是一个数组 描述 void list ( mixed $varname [, mixed $... ] ) 像阵列( ) ,这是不是一个真正的功能,而是一种语言结构。名单( )是用来指定名单中的变数之一作业。 参数 varname 一个变量。 返回值 没有价值的返回。 实例 例如# 1名单( )的例子

复制代码 代码如下:

<?php $info = array('coffee', 'brown', 'caffeine'); // Listing all the variables list($drink, $color, $power) = $info; echo "$drink is $color and $power makes it special.n"; // Listing some of them list($drink, , $power) = $info; echo "$drink has $power.n"; // Or let's skip to only the third one list( , , $power) = $info; echo "I need $power!n"; // list() doesn't work with strings list($bar) = "abcde"; var_dump($bar); // NULL ?>

另外参考: http://HdhCmsTestjb51.net/w3school/php/func_array_list.htm

查看更多关于本篇文章是对php中的list()函数进行了详细的分析的详细内容...

  阅读:40次