This article mainly introduces PHP regular expression matching to replace the image address. if you are interested in the PHP Tutorial, refer to it. PHP regular expression match to replace the image address:
Many regular expressions matching the image src and replacement instances can be found on the Internet, but the problem cannot be solved immediately.
Just find the section in src and replace it.
For a piece of content:
$ Content = '';
Regular Expression Matching replacement:
Preg_replace ("/()/is", "\$ {1} asdf \ $ {3}", $ content );
$ Content can be all the content in a tag. the content in src can be circled separately, and the content before and after the tag is included, $ {1} and $ {3} are the contents before and after src. replace src with the desired one.
The above introduces the PHP regular expression matching and replacement image address, including the content. For more information, see PHP Chinese website (www.php1.cn )!