Home > Backend Development > PHP Tutorial > 求一正则表达式,替换某一规则的表情符号为表情图标(<img>表情)解决思路

求一正则表达式,替换某一规则的表情符号为表情图标(<img>表情)解决思路

WBOY
Release: 2016-06-13 13:33:54
Original
1009 people have browsed it

求一正则表达式,替换某一规则的表情符号为表情图标( 求一正则表达式,替换某一规则的表情符号为表情图标(<img>表情)解决思路 表情)
求一正则表达式,替换某一规则的表情符号为表情图标( 求一正则表达式,替换某一规则的表情符号为表情图标(<img>表情)解决思路 表情)

[高兴] 替换为  求一正则表达式,替换某一规则的表情符号为表情图标(<img>表情)解决思路 (用中文命名图片规不规范?)

其实最好还是用JS来比较好的。

------解决方案--------------------
$str='[高兴]表情图片';
echo preg_replace('/\[(.*)\]/'," 求一正则表达式,替换某一规则的表情符号为表情图标(<img>表情)解决思路 ",$str);

------解决方案--------------------
这年头,什么都正则...
用中文名做文件名的确不是明智的做法.

function replaceStr($str){
$str=substr($str,strpos($str,'[')+1,strlen($str)-2);
return " 求一正则表达式,替换某一规则的表情符号为表情图标(<img>表情)解决思路 ";
}

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template