Filter out some character problems
Extraction #row#99#col#fenpeixishu.gif#row# of 91#col# and #row#97#col#jiaotilizi.gif#row#98#col# in chemical dosage
Structure is like this: ID + #col # + name + #row #
91#col# in the dosage and #row# 97#col#jiaotilizi.gif#row#
A lot of this data to dispose of GIF
PHP Code
$contents = Preg_replace ('/[\w] #col # (. *?). gif#row# '/I, ', $contents);
I would like to replace it with empty, is this method not very good?
And this is a mistake.
------Solution--------------------
If you are dealing with a fixed string, you can use the Str_replace () function
------Solution--------------------
Such?
PHP Code
$str = "91#col# dosing and #row#97#col#jiaotilizi.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