$temp="你是一只狗"; ///echo strCon($temp); function strCon($temp){ $out=""; $out.=preg_replace('/./u','<font>$0</font>',$temp); return $out; }//strCon //--- echo "<br />"; echo strCon($temp); //替换后,$temp格式如下: <font>你</font><font>是</font><font>一</font><font>只</font><font>狗</font>
php正则替换,加标签
阅读:4863 输入:2018-05-11 08:03:26