Filter some questions 91w.colw.dosing and row%97%col%jiaotilizi.gif # row #98 # col # extraction # row #99 # col # FenPeiXiShu. GIF # row # structure is like this: id + # col # + name + # row #91 # col # neutralization # row #97 # col # JiaoTi filter out some characters
91#col1_dosing and %row%97%col%jiaotilizi.gif # row #98 # col # extraction # row #99 # col # FenPeiXiShu. GIF # row #
The structure is as follows: id + # col # + name + # row #
91 # col # neutralization # row # 9720.col1_jiaotilizi.gif # row #
A lot of such data should be processed out of gif
PHP code
$contents = preg_replace('/[\w]#col#(.*?).gif#row#'/i,'',$contents);
I want to replace it with NULL. Isn't this a good method?
And this regular expression is incorrect.
------ Solution --------------------
If fixed strings are processed, use the str_replace () function.
------ Solution --------------------
So?
PHP code
$ Str = "91w.colw.lizi.gif # row #98 # col # extraction # row #99 # col # FenPeiXiShu. GIF # row # "; $ str = preg_replace ('/# [\ d?##col==a-z?#.gif # row #/is', '#', $ str); echo $ str;
------ Solution --------------------
PHP code
$ Contents = preg_replace ('/(col # [^ \.] + )\. gif (# row)/I ',' $1 $ 2', $ s); echo $ contents;
------ Solution --------------------
PHP code
When string'91w.colw.com and then row%97%col%jiaotilizi.gif # row #98 # col # extraction # row #99 # col # FenPeiXiShu. GIF # row # '; echo preg_replace ('/\ d * # col # [^ #] * (? <= Gif) # row #/I ', '', $ str );