我有一個聲明替換在PHP中做(使用str_replace或其他)。我有這樣的句子: "the sun is yellow when the <wrong>red sun is not yellow</wrong>" 我想這一點: "the apple is yellow when the <wrong>red sun is not yellow</wrong>" 所以我需要更換一個字,但有兩個特定
爲什麼在第一種情況下,html em標籤正常打印,而在第二個測試中,它們消失。
var text = "text";
eval("var text = text.replace(/(.*)(ex)(.*)/gi,'$1<em>$2</em>$3');");
console.log(text) //text -> t<em>ex</em>t
但
var textx = text.r