php过滤非法字符函数

<p > if (!get_magic_quotes_gpc())<br /> {<br /> safeVar($_GET);<br /> safeVar($_POST);<br /> safeVar($_COOKIE);<br /> }</p> <p ><span ><span ><span >php过滤非法字符函数</span></span></span></p> <p >function safeVar(&amp;$data)<br /> {<br /> if (is_array($data))<br /> {<br /> foreach ($data as $key =&gt; $value)<br /> {<br /> safeVar($data[$key]);<br /> }<br /> }else{<br /> $data = addslashes($data);<br /> }<br /> }</p>
RangeTime:0.008625s
RangeMem:204.05 KB
返回顶部 留言