当前位置:Gxlcms > PHP教程 > PHP提交自动过滤掉input框内的指定字符,怎么写呢?

PHP提交自动过滤掉input框内的指定字符,怎么写呢?

时间:2021-07-01 10:21:17 帮助过:46人阅读

PHP

提交数据时,将所有input内的 字符过滤掉,并保留其他内容。
这个怎么写呢


回复讨论(解决方案)

$s=str_replace('>'https://www.gxlcms.com/,''https://www.gxlcms.com/,str_replace(' 

|iUs';$post=$_POST['value'];preg_match($srchttps://www.gxlcms.com/,$posthttps://www.gxlcms.com/,$v);print_r($v);?>

要是提交数据的时候处理而不是接收数据的时候处理的话,那就得用正则了,
var s=document.getElementById('input_id');
s=s.replace(/(+/ighttps://www.gxlcms.com/,"");
做了不区分大小写和多行的处理,看是不是你要的吧。

preg_match('/"(.*)?.[a-Z]{3https://www.gxlcms.com/,4}"/i'https://www.gxlcms.com/,$input_valuehttps://www.gxlcms.com/,$arr);
echo $arr[0];

人气教程排行