人人人妻人人人妻人人人,99精品国产综合久久久久五月天 ,欧美白人最猛性XXXXX,日韩AV无码免费播放

News新聞

業(yè)界新聞動態(tài)、技術前沿
Who are we?

您的位置:首頁      樂道系統(tǒng)FAQ      PHP實現(xiàn)動態(tài)獲取函數(shù)參數(shù)的方法示例

PHP實現(xiàn)動態(tài)獲取函數(shù)參數(shù)的方法示例

標簽: 發(fā)布日期:2018-04-18 21:57:49 293

本文實例講述了PHP實現(xiàn)動態(tài)獲取函數(shù)參數(shù)的方法。分享給大家供大家參考,具體如下:

PHP 在用戶自定義函數(shù)中支持可變數(shù)量的參數(shù)列表。其實很簡單,只需使用 func_num_args() , func_get_arg() ,和 func_get_args()  函數(shù)即可。

可變參數(shù)并不需要特別的語法,參數(shù)列表仍按函數(shù)定義的方式傳遞給函數(shù),并按通常的方式使用這些參數(shù)。

1. func_num_args — 返回傳入函數(shù)的參數(shù)總個數(shù)

int func_num_args ( void )

示例

<?php
function demo ()
{
  $numargs = func_num_args ();
  echo "參數(shù)個數(shù)為: $numargs \n" ;
}
demo ( 'a' , 'b' , 'c' );