【发布时间】:2012-06-16 04:04:12
【问题描述】:
我正在尝试使用htmlspecialchars_decode 和preg_replace 解码两个特殊标签之间的字符串,例如我的原始字符串是这样的:
other strings...[link]<a href="http://example.com" target="_blank">example</a>[/link]other strings...
我需要将 [link][/link] 之间的所有内容转换为 html 原始代码。对此进行了测试:
$str = preg_replace("/[link](.*)[\/link]/eisU", "htmlspecialchars_decode('$1')", $str);
没有用!我也搜索了 google 和 SO 但没用!
【问题讨论】:
标签: php html string replace special-characters