考慮以下幾點:如何從字符串中刪除標籤?
$string = "A string with {LABELS} and {more|232} {lbls} and some other stuff";
echo str_replace('/(\{.*?\})/', '', $string);
我試圖去除所有標籤(標籤是{brackets}
之間的任何文本)。預期產量爲:
A string with and and some other stuff
但是我所得到的是原始字符串:
A string with {LABELS} and {more|232} {lbls} and some other stuff
我在做什麼錯?
你的問題中的2個字符串是一樣的!?!?! – ManseUK 2012-04-17 15:28:00
您的預期和實際結果看起來一樣。 – 2012-04-17 15:28:06
我看到預期和原始之間沒有區別。 – elmo 2012-04-17 15:28:08