欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          php怎么獲取當(dāng)前方法的參數(shù)值

          方法:1、利用func_get_arg(),可返回當(dāng)前方法中指定位置的參數(shù)值,語法“func_get_arg(數(shù)值)”;2、利用func_get_args(),可返回包含當(dāng)前方法所有參數(shù)值的一個數(shù)組,語法“func_get_args()”。

          php怎么獲取當(dāng)前方法的參數(shù)值

          本教程操作環(huán)境:windows7系統(tǒng)、PHP7.1版、DELL G3電腦

          php獲取當(dāng)前方法的參數(shù)值

          方法1:利用func_get_arg()函數(shù)

          func_get_arg()函數(shù)可返回當(dāng)前方法中指定位置的參數(shù)值

          示例:

          <?php header("Content-type:text/html;charset=utf-8"); class Website { 	public function Write(){  		echo "第二個參數(shù)值為: " . func_get_arg(1) . "<br />n"; 	}  } $object = new Website(); $object -> Write(1,2,3); ?>

          輸出結(jié)果:

          php怎么獲取當(dāng)前方法的參數(shù)值

          方法2:利用func_get_args()函數(shù)

          func_get_args()可返回包含當(dāng)前方法所有參數(shù)值的一個數(shù)組

          示例:

          <?php header("Content-type:text/html;charset=utf-8"); class Website { 	public function Write(){ 		$arg_list = func_get_args();  		var_dump($arg_list); 	}  } $object = new Website(); $object -> Write(1,2,3); ?>

          輸出結(jié)果:

          php怎么獲取當(dāng)前方法的參數(shù)值

          推薦學(xué)習(xí):《PHP視頻教程》

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號