Php Regular Expression replacement and regular expression replacement functions/* Below we want to replace the null in the specified regular expression with another content. In this case, we need to use the regular expression replacement function preg_replace, the following instance is
Php tutorial Regular Expression replacement and regular expression replacement Functions
/*
In the following example, we want to replace the specified regular expression with another content. In this case, we will use the regular expression replacement function preg_replace. The following example is:
The text has the following labels:
/Images/styleno.jpg "width =" 30 "height =" 30 "/>
/Images/styleno.jpg "width =" 30 "height =" 30 "/>
I want to replace them with regular expressions
Replace a style with /Images/styleno.jpg "width =" 30 "height =" 30 "/>
Replace the style with /Images/styleno.jpg "width =" 30 "height =" 30 "/>
*/
$ Content1 = ' /Images/styleno.jpg "width =" 30 "height =" 30 "/> ';
$ Content = ' ';
$ A = ' /Images/styleno.jpg "width =" 30 "height =" 30 "/> ';
Echo preg_replace ('//I ', $ a, $ content );
$ Content1 = ' ';
$ B = ' /Images/styleno.jpg "width =" 30 "height =" 30 "/> ';
Echo preg_replace ('//I ', $ B, $ content1 );