深入php list()函數(shù)的詳解
list()
( PHP 4中, PHP 5中)
list-指定變量,好象他們是一個數(shù)組
描述
void list ( mixed $varname [, mixed $... ] )
像陣列( ) ,這是不是一個真正的功能,而是一種語言結(jié)構(gòu)。名單( )是用來指定名單中的變數(shù)之一作業(yè)。
參數(shù)
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://www.dbjr.com.cn/w3school/php/func_array_list.htm
相關(guān)文章
php session_start()關(guān)于Cannot send session cache limiter - hea
在windows下編程,當使用session_start()方法的時候,有時會報 session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/inpublisher/php1.php:1)這樣的錯誤2009-11-11學習php設(shè)計模式 php實現(xiàn)觀察者模式(Observer)
這篇文章主要介紹了php設(shè)計模式中的觀察者模式,使用php實現(xiàn)觀察者模式,感興趣的小伙伴們可以參考一下2015-12-12php-accelerator網(wǎng)站加速PHP緩沖的方法
我們知道 Zend 有免費的優(yōu)化引擎針對 PHP 而作,但是 FreeLAMP 這次采用的是一個叫做 PHP Accelerator 的緩沖產(chǎn)品。2008-07-07