Home  >  Article  >  Backend Development  >  新手提问:PHP里面的正则表达式怎么使用

新手提问:PHP里面的正则表达式怎么使用

WBOY
WBOYOriginal
2016-06-13 10:36:581000browse

新手提问:PHP里面的正则表达式如何使用?
preg_replace('(新手提问:PHP里面的正则表达式怎么使用?', "$1$2src='/images/po.png' lazy-src=$3", $data);

正则表达式在开发工具只测试正确,但在PHP中无法生效,是不是使用的方式不对?

PHP不熟练,求指点。

------解决方案--------------------
echo preg_replace('/(新手提问:PHP里面的正则表达式怎么使用?/', "$1$2src='/images/po.png' lazy-src=$3", $data);

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