欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript,php獲取函數(shù)參數(shù)對(duì)象的代碼

 更新時(shí)間:2011年02月03日 15:10:59   作者:  
javascript,php獲取函數(shù)參數(shù)對(duì)象的代碼,需要的朋友可以參考下。
例如:
復(fù)制代碼 代碼如下:

function say () {
alert (arguments[0]+'說:'+arguments[1]);
}
say ('fanglor','fanglor is a boy !');

結(jié)果:彈出 fanglor 說:fanglor is a boy !
--------------------------------------------------------------------------------
這個(gè)有點(diǎn)類似于php 中的 func_get_args() 函數(shù),也是獲取函數(shù)參數(shù)的數(shù)組。
例(以下是php代碼):
復(fù)制代碼 代碼如下:

function uses () {
$args =func_get_args();
if (!empty($args)) {
foreach ($args as $key => $val ) {
if (file_exists($val.'.php')) {
include "{$val}.php";
} else {
if (DEBUG) {
echo "{$val}.php 不存在!";
}
}
}
}
}
//再次封裝 include
uses ('config','db');

自動(dòng)裝載 config.php 和 db.php ,如不存在,顯示 {__file__}.php不存在.

相關(guān)文章

最新評(píng)論