To find a regular expression, replace a regular emoticon with an emoticon (emoticon)
[Happy] to be replaced by (the Chinese name of the picture is not regulated?) )
In fact, it is better to use JS to better.
Reply to discussion (solution)
$str = ' [happy] emoji image ';
echo preg_replace ('/\[(. *) \]/', "", $str);
These days, everything is in the right ...
It is certainly not advisable to use Chinese names for filenames.
function Replacestr ($STR) {
$str =substr ($str, Strpos ($str, ' [') +1,strlen ($STR)-2);
Return "";
}
Excuse me, how efficient is it to replace the entire page?
$str = ' [happy] emoji image ';
echo preg_replace ('/\[(. *) \]/', "", $str);
should also be acceptable.
I found a JQ plugin on the Internet, in the client to replace, for [happy] this kind of English emoji can be replaced, but once the [happy] Chinese emoji do not, um, I also feel that the Chinese do not have a bad file name.
JQuery Plugins:on/off emtions var __emotion__cache = false;jquery.fn.emotions = function () { var aemotion = new Ar Ray (); AEMOTION[21] = new Array (' [Happy] ', ' \\[happy\\] '); __emotion__cache = true; This.each (function () { str = $ (this). html (); For (IEM in aemotion) { reg = new RegExp (aemotion[iem][1], "IG"); str = str.replace (Reg, "); } $ (this). html (str); }); JQuery.fn.unemotions = function () { __emotion__cache = false; $ ('. Plugin_emotion '). each (function () { $ (this). HTML (decodeuricomponent (this.title)); });}
These days, everything is in the right ...
It is certainly not advisable to use Chinese names for filenames.
function Replacestr ($STR) {
$str =substr ($str, Strpos ($str, ' [') +1,strlen ($STR)-2);
Return "";
}
Chinese file name is very bad all kinds of incompatible egg ache ...
Take a look at the wood with the wrong hints.
alert (str);
See if it's replaced.
It is estimated that the name of the image is the Chinese name reason. Switch to English.
The JQ plugin is a 0.png, 1.png, 2.png replacement [face]
But it's strange to change face to Chinese.
Take a look at the wood with the wrong hints.
alert (str);
See if it's replaced.
It is estimated that the name of the image is the Chinese name reason. Switch to English.