久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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 Function split() is deprecated 的問(wèn)題

      php升級(jí)為5.3后,程序會(huì)報(bào) Function split() is deprecated 的錯(cuò)誤。

      這是因?yàn)榉N種原因(主要是關(guān)于正則的原因,具體見(jiàn)后),split這個(gè)函數(shù)在新版本不支持了。

      在php中,再使用deprecated的函數(shù)會(huì)報(bào)錯(cuò),必須改掉。(java里deprecated的函數(shù)只是給警告,還可以繼續(xù)用)

      改為什么呢? 看第一個(gè)參數(shù),如果第一個(gè)參數(shù)不是正則表達(dá)式,split改為 explode;如果是正則表達(dá)式,split改為preg_split。

      explode會(huì)比以前快很多,因?yàn)橐郧耙紤]正則,explode不考慮正則。

      PHP 5.3.0 之後的 regex, 希望使用 PCRE 的規(guī)格, POSIX Regex 都不建議使用了(統(tǒng)一 Regex, 避免規(guī)格太多?).

      所以下述是不建議使用的 Function (POSIX), 與建議替換成的 Function (PCRE) 列表, 詳可見(jiàn): PHP:

      Differences from POSIX regex * POSIX → PCRE * ereg_replace() → preg_replace() * ereg() → preg_match() * eregi_replace() → preg_replace() * eregi() → preg_match() * split() → preg_split() * spliti() → preg_split() * sql_regcase() → No equivalent

      * 需要 regex 的 split, 可用 preg_split() 代替

      * 不需要 regex, 只要要快速分割固定的字串, 可用 explode() 代替. (速度會(huì)比需要 regex 的快很多)

      推薦:《PHP教程》

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