您好,欢迎访问一九零五行业门户网

PHP搜索和高亮字符串中的关键字

function highlighter_text($text, $words){ $split_words = explode( , $words ); foreach($split_words as $word) { $color = #4285f4; $text = preg_replace(|($word)|ui , $1 , $text ); } return $text;}
复制代码
用法:
复制代码
php
其它类似信息

推荐信息