Home  >  Article  >  Backend Development  >  PHP regular expression replacement and regular replacement function_PHP tutorial

PHP regular expression replacement and regular replacement function_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 16:59:01849browse

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);

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631360.htmlTechArticlephp regular expression replacement and regular replacement function/* Below we need to replace the inner space of the specified regular expression with Different content, to do this we will use the regular replacement function preg_repla...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn