久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長資訊網
      最全最豐富的資訊網站

      php怎么獲取類中方法名

      php獲取類中方法名的兩種方法:1、使用魔術常量“__FUNCTION__”,可以返回類中當前方法的名稱。2、使用get_class_methods()函數,可以獲取指定類中所有方法的名稱,返回一個包含所有方法名的數組,語法“get_class_methods('類名')”或“get_class_methods(new 類名())”。

      php怎么獲取類中方法名

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

      php獲取類中方法名的兩種方法

      方法1:使用魔術常量__FUNCTION__

      __FUNCTION__:返回類中當前方法的名稱。

      <?php header('content-type:text/html;charset=utf-8');   class myclass {     // constructor     function myclass()     {         echo '成員方法名為:'.__FUNCTION__."<br>";     }      // method 1     function myfunc1()     {         echo '成員方法名為:'.__FUNCTION__."<br>";     }      // method 2     function myfunc2()     {         echo '成員方法名為:'.__FUNCTION__."<br>";     } }  $class_methods = new myclass(); $class_methods -> myfunc1(); $class_methods -> myfunc2(); ?>

      php怎么獲取類中方法名

      方法2:使用get_class_methods()函數

      get_class_methods — 獲取類的所有的方法名,并且組成一個數組;如果出錯,則返回 null。

      <?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());  var_dump($class_methods);  ?>

      php怎么獲取類中方法名

      推薦學習:《PHP視頻教程》

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