久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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如何獲取類的所有方法

      php獲取類的所有方法的方法:可以利用get_class_methods()函數(shù)來獲取。get_class_methods()函數(shù)返回由類的方法名組成的數(shù)組,如果失敗則返回NULL。

      php如何獲取類的所有方法

      get_class_methods()函數(shù)返回由類的方法名組成的數(shù)組。

      (推薦教程:php圖文教程)

      語法:

      array get_class_methods ( mixed $class_name )

      返回由 class_name 指定的類中定義的方法名所組成的數(shù)組。如果出錯(cuò),則返回 NULL。

      注意:從 PHP 4.0.6 開始,可以指定對(duì)象本身來代替 class_name。

      (視頻教程推薦:php視頻教程)

      例如:

      <?php $class_methods = get_class_methods($my_object); // see below the full example ?>

      代碼示例:

      <?php class myclass {     // constructor     function myclass()     {         return (true);     }       // method 1     function myfunc1()     {         return (true);     }       // method 2     function myfunc2()     {         return (true);     } }   $class_methods = get_class_methods('myclass');   // or $class_methods = get_class_methods(new myclass()); foreach ($class_methods as $method_name) {     echo "$method_name"; }

      輸出結(jié)果:

      myclass myfunc1 myfunc2

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