怎么实现不了? $C_char=ereg_replace("<[^>]*>","",$C_char);改为$C_char=ereg_replace("<[^>]+*>","",$C_char);试试看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $title="<b>this is test</b>";echo "$title <br>";$title_1 = charreplace($title);echo "$title_1"; <?function charreplace($C_char){$C_char=addslashes($C_char);$C_char=ereg_replace("<[^>]*>","",$C_char);return $C_char;}$title="<font color=red>this is test</font>";echo "$title <br>";$title=charreplace($title);echo "$title";?>第二次输出$title时,$title还是原来的值啊,没有重新赋值。 改了的就变成这样了:Warning: REG_BADRPT in /usr/local/apache/htdocs/test.php on line 11 请问 uGain(幽亘) 那应该怎样做才能实现呢? wangxiangjun_sun() 说的是对的了。谢谢哦。 把charreplace($title);改成$title = charreplace($title); 不好意思,刚刚搞错了$title="<b>this is test</b>";echo "$title <br>";charreplace($title);echo "$title";第二个echo并没有输出新值$title="<b>this is test</b>";echo "$title <br>";$title=charreplace($title);echo "$title"; 没有问题请看<?$a="<b>aaa</b>";$b=ereg_replace("<[^>]*>","",$a);echo $b;//aaa?> 完整程序代码应该是function charreplace($C_char){$C_char=addslashes($C_char);$C_char=ereg_replace("<[^>]*>","",$C_char);return $C_char;}$title="<b>this is test</b>";echo "$title <br>";$title=charreplace($title);echo "$title";有两个问题:1. 没有保存新的结果2. return 语句后遗漏一个$ 根本不仔细看回复的。sigh EXT整合PHP的问题 js调用php问题 PDO参数化查询问题 请问模块化开发从哪入手啊 用include包含的文件里面还有<?php ?>可以吗 为什么循环出来是一样的数个信息 如何实现象csdn社区的界面上点击左边“X”来隐藏左边,或点击右边的“显示导航栏”来显示左边的? 高分请求帮忙解决确认对话框的问题 求解"&"的用法,绝顶高手入来吧。 这是 bug 吗? 请教如何验证提交的表单!大家帮个忙吧! 有51.net空间的朋友来看看,Session为什么不能用
echo "$title <br>";
$title_1 = charreplace($title);
echo "$title_1";
function charreplace($C_char)
{
$C_char=addslashes($C_char);
$C_char=ereg_replace("<[^>]*>","",$C_char);
return $C_char;
}$title="<font color=red>this is test</font>";
echo "$title <br>";
$title=charreplace($title);
echo "$title";
?>
第二次输出$title时,$title还是原来的值啊,没有重新赋值。
$title="<b>this is test</b>";
echo "$title <br>";
charreplace($title);
echo "$title";
第二个echo并没有输出新值
$title="<b>this is test</b>";
echo "$title <br>";
$title=charreplace($title);
echo "$title";
<?
$a="<b>aaa</b>";
$b=ereg_replace("<[^>]*>","",$a);
echo $b;//aaa
?>
function charreplace($C_char)
{
$C_char=addslashes($C_char);
$C_char=ereg_replace("<[^>]*>","",$C_char);
return $C_char;
}$title="<b>this is test</b>";
echo "$title <br>";
$title=charreplace($title);
echo "$title";有两个问题:
1. 没有保存新的结果
2. return 语句后遗漏一个$
sigh