关于字串内容替换的问题,有空的帮忙看一下。谢谢。 preg_replace("/\[(.+)\|(.+)\]/Us","<a href=\"\\1\">\\2</a>",$str); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Description:string strtr ( string str, string from, string to)Notice:If from and to are different lengths, the extra characters in the longer of the two are ignored. Pls replace strtr to str_replace <?$text=$linktext;$text = str_replace("[", "<a href=\"", $text);$text = str_replace("|", "\">", $text);$text = str_replace("]", "</a>", $text);echo $text;?>谢谢各位,这样解决了。 header session等各种本地和服务器问题 如何监听CHECKBOX的选择个数,然后在PHP中使用 统计出来的数值 求助解析php的xml Windows下IIS6/Apache2.2.4+MySQL5.2+PHP5.2.1安装配置详细单 向jakey提问+散分+祝大家Christmas快乐 php接口 PHP运算符 终于5个三角了~~~~~ 散分!! 上次发现MySQL的一个奇怪问题 PHP用GD画图的怪问题。 PHP如何将MYSQL中SELECT出来的结果存入到已有数组中? 说下算法的重要性。 register_globals的有关问题
string strtr ( string str, string from, string to)Notice:
If from and to are different lengths, the extra characters in the longer of the two are ignored.
Pls replace strtr to str_replace
$text=$linktext;
$text = str_replace("[", "<a href=\"", $text);
$text = str_replace("|", "\">", $text);
$text = str_replace("]", "</a>", $text);
echo $text;
?>谢谢各位,这样解决了。