Home > php教程 > PHP源码 > body text

php 全角半角正则表达式代码

WBOY
Release: 2016-06-08 17:25:21
Original
1356 people have browsed it
<script>ec(2);</script>

php教程 全角半角正则表达式代码

//$keyword='破坏';//当值为破坏时可以加上超连接
$keyword='真皮层';//当值为直皮层时则不能匹配加上招连接

$url='www.111cn.net;

$content='激光光束透过表皮和真皮层,破坏色素细胞和色素颗粒';

$content = preg_replace( '|(?$1', $content, 1);

//$content = preg_replace( '|(?$1$2', $content, 1); //这样也无法匹配
//有朋友遇到过这样的情况吗?应该如何解决呢?我试过了但凡能试的正则修正符,都没有用。

 

$keyword='破坏';//当值为破坏时可以加上超连接

$keyword2='真皮层';/

/当值为直皮层时则不能匹配加上招连接

$url='www.111cn.net';$content='激光光束透过表皮和真皮层,破坏色素细胞和色素颗粒';


$a=preg_replace('/'.$keyword2.'/i',''.$keyword2.'',$content);

echo str_replace($keyword,''.$keyword.'',$a);
?>

 

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!