4,5行不懂求解释 无 ?phpfunction str($str){$array = array("1","2","3","4","5","6");$repstr = implode($array);if(preg_match("/$str/",$repstr)){echo "scriptalert('您使用了禁用词语,请重新填写');location.href='16.php'/script";}else{echo "内容为
4,5行 不懂 求解释
<?php
function str($str){
$array = array("1","2","3","4","5","6");
$repstr = implode($array);
if(preg_match("/$str/",$repstr)){
echo "<script>alert('您使用了禁用词语,请重新填写');location.href='16.php'</script>";
}else{
echo "内容为:".$str;
}
}
if(!empty($_POST['sub'])){
str($_POST['te']);
}
?>
<html>
<head>
<title>过滤字符串</title>
<meta charset=utf-8">
</head>
<body>
<form action="" method="post">
<b style="float:left">内容:</b><textarea cols="18" rows="2" name="te"></textarea>
<p><center><input type="submit" name="sub" value="提交"></center></p><div class="aritcle_card flexRow">
<div class="artcardd flexRow">
<a class="aritcle_card_img" href="/ai/953" title="会译·对照式翻译"><img
src="https://img.php.cn/upload/ai_manual/000/000/000/175680006754283.png" alt="会译·对照式翻译" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a href="/ai/953" title="会译·对照式翻译">会译·对照式翻译</a>
<p>会译是一款AI智能翻译浏览器插件,支持多语种对照式翻译</p>
</div>
<a href="/ai/953" title="会译·对照式翻译" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a>
</div>
</div>
</form>
</body>
</html>









