久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php怎么獲取對(duì)象的所有方法名

      在php中,可以使用get_class_methods()函數(shù)來獲取對(duì)象的所有方法名,該函數(shù)可獲取指定類(對(duì)象)的所有方法名,并將方法名組成數(shù)組來返回,語法“get_class_methods($obj)”。

      php怎么獲取對(duì)象的所有方法名

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

      在php中,可以使用get_class_methods()函數(shù)來獲取對(duì)象的所有方法名。

      get_class_methods()函數(shù)可獲取指定類(對(duì)象)的所有方法名,并且組成一個(gè)數(shù)組。如果出錯(cuò),則返回 null。

      <?php class Website { 	public $name, $url, $title; 	 	// method 1 	public function demo1() { 		return (true); 	}  	// method 2 	function demo2() { 		return (true); 	}  	// method 3 	function demo3() { 		return (true); 	}  }  //實(shí)例化對(duì)象 $student = new Website();  $methods = get_class_methods($student); var_dump($methods);

      php怎么獲取對(duì)象的所有方法名

      擴(kuò)展知識(shí):如何獲取當(dāng)前的類名和方法名?

      想要獲取當(dāng)前的類名和方法名,可以利用魔術(shù)常量“__CLASS__”、“__FUNCTION__”和“__METHOD__”

      • __CLASS__:當(dāng)前的類名(包括該類的作用區(qū)域或命名空間);

        自 PHP 5 起本常量返回該類被定義時(shí)的名字(區(qū)分大小寫)。在 PHP 4 中該值總是小寫字母的。

      • __FUNCTION__:當(dāng)前函數(shù)(或方法)的名稱;

      • __METHOD__:當(dāng)前的方法名(包括類名);

        返回該方法被定義時(shí)的名字(區(qū)分大小寫)。

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

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