php 老舊版本函數(shù)變化和棄用

字號(hào):


    錯(cuò)誤提示:Deprecated: Assigning the return value of new by reference is deprecated in
    Deprecated: Function ereg() is deprecated
    Function split() is deprecated
    上面php錯(cuò)誤都是有低版本程序在高版本的服務(wù)器上面運(yùn)行導(dǎo)致的,在5.3以后一些函數(shù)就棄用了。如果想運(yùn)行老程序則需要降低php版本
    下面列出一些新舊版本的函數(shù)以及修改的地方
    正則相關(guān),正則的轉(zhuǎn)換已經(jīng)要注意原來的正則表達(dá)式一般沒有/rule/的斜杠,后面的都有了
    ereg_replace() preg_replace()
    ereg() preg_match()
    eregi_replace() preg_replace()
    eregi() preg_match()
    替換相關(guān)
    split() preg_split()
    spliti() preg_split()
    類符號(hào)
    =& 類相關(guān)已經(jīng)棄用,直接用=號(hào)即可。如果是連接符,仍然可用
    功能
    split 換成explode
    以上就是常見的php版本出現(xiàn)的函數(shù),或者版本問題。