Home >Backend Development >PHP Tutorial >PHP匹配非关键字加粗的有关问题

PHP匹配非关键字加粗的有关问题

WBOY
WBOYOriginal
2016-06-13 10:06:40878browse

PHP匹配非关键字加粗的问题
PHP如何匹配从左到右只匹配一次关键字,非关键词进行加粗

如下:

关键字:abc 标题:abcdefgabcdefg

匹配后得到(包含html代码):abcdefgabcdefg

也就是说输入关键词abc后进行匹配标题只匹配标题中第一个abc而后面的abc是不会被匹配出来的

请问下这个如何实现

我现在做的只能全部匹配而不能从左到右只匹配一次




------解决方案--------------------
速度结帖

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