Home > Article > Backend Development > PHP regular expression replacement and regular replacement function_PHP tutorial
php regular expression replacement and regular replacement function /* Next, we need to replace the inner space of the specified regular expression with another content. To do this, we will use the regular replacement function preg_replace. The following example is
php tutorial regular expression replacement and regular replacement function
/*
Next, we need to replace the inner space of the specified regular expression with another content. To do this, we will use the regular replacement function preg_replace. The following example is
The text has the following tag
I want to use regular expressions to replace them with
If there is style, replace it with
If there is no style, replace it with*/
$content1 ='';
$content ='';
$a='';
echo preg_replace('//i',$a,$content); $content1 ='';
$b='';
echo preg_replace('//i',$b,$content1);