Filter out some characters about the problem

Source: Internet
Author: User
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
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.