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

      php魔術(shù)方法有哪些

      php魔術(shù)方法:1、【_sleep()】控制對(duì)象序列化時(shí)真正處理的部分;2、【_wakeup()】在反序列化后還原對(duì)象屬性;3、【_toString()】對(duì)象轉(zhuǎn)換成為字符串的機(jī)制。

      php魔術(shù)方法有哪些

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

      php魔術(shù)方法:

      _sleep() 可以控制對(duì)象序列化時(shí)真正處理的部分

      _wakeup() 在反序列化后還原對(duì)象屬性

      _toString() 對(duì)象轉(zhuǎn)換成為字符串的機(jī)制

      把php變量轉(zhuǎn)換成一串編碼后字符串,方法為serialize() 反序列化unserialize()

        //序列化   class testSerialize{    public $a = 10;    public $b = 15;    public $c = 20;    function _construct(){    $this->b = $this->a * 10;    $this->c = $this->b * 2;    }    } $k = serialize(new testSerialize()); echo $k;// out:  O:13:"testSerialize":3:{s:1:"a";i:10;s:1:"b";i:15;s:1:"c";i:20;} $j = unserialize($k);

      sleep方法:

      class testSerialize1{    public $a = 10;    public $b = 15;    public $c = 20;    function _construct(){    $this->b = $this->a * 10;    $this->c = $this->b * 2;    }     function __sleep(){    return $this->a;    }   } $k = serialize(new testSerialize1()); echo $k;

      其他方法同理

      相關(guān)視頻推薦:PHP編程從入門到精通

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