<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>https://jackxiang.com/post/5449/</link>
<title><![CDATA[[实践Ok]php addslashes对Post多维数组过渡处理$_POST 数组替代magic_quotes_gpc=on]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Tue, 31 Jul 2012 09:20:47 +0000</pubDate> 
<guid>https://jackxiang.com/post/5449/</guid> 
<description>
<![CDATA[ 
	php -i&#124;grep&nbsp;&nbsp;magic_quotes_gpc<br/>magic_quotes_gpc =&gt; Off =&gt; Off<br/><br/>注释：默认情况下，PHP 指令 magic_quotes_gpc 为 on，对所有的 GET、POST 和 COOKIE 数据自动运行 addslashes()。不要对已经被 magic_quotes_gpc 转义过的字符串使用 addslashes()，因为这样会导致双层转义。遇到这种情况时可以使用函数 get_magic_quotes_gpc() 进行检测。<br/><br/><br/>php addslashes处理$_POST $_GET数组函数：<br/><textarea name="code" class="php" rows="15" cols="100">
//添加对Post数组进行处理的Addslashes遍历方法：Recursive Function to add slashes with posted array.
function addslashes_array($input_arr)&#123;
&nbsp;&nbsp;&nbsp;&nbsp;if(is_array($input_arr))&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$tmp = array();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach ($input_arr as $key1 =&gt; $val)&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$tmp[$key1] = addslashes_array($val);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $tmp;
&nbsp;&nbsp;&nbsp;&nbsp;&#125;else&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return addslashes($input_arr);
&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&#125;
/**
 * 给所有的Post数组里的值都给addslashes一遍
 */
function postAllArr2AddSlashes()
&#123;
&nbsp;&nbsp;//create array to temporarily grab variables
&nbsp;&nbsp;$input_arr = array();
&nbsp;&nbsp;//grabs the $_POST variables and adds slashes
&nbsp;&nbsp;foreach ($_POST as $key =&gt; $input_arr) &#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(is_array($input_arr))&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$_POST[$key] = addslashes_array($input_arr);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;else&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$_POST[$key] = addslashes($input_arr);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&#125;
&#125;
</textarea><br/><br/>调用：<br/><textarea name="code" class="php" rows="15" cols="100">
postAllArr2AddSlashes();//给所有的Post数组里的值都给addslashes一遍
</textarea><br/>
]]>
</description>
</item><item>
<link>https://jackxiang.com/post/5449/#blogcomment63788</link>
<title><![CDATA[[评论] [实践Ok]php addslashes对Post多维数组过渡处理$_POST 数组替代magic_quotes_gpc=on]]></title> 
<author>红酒木瓜靓汤 &lt;654654@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 02 Aug 2012 08:10:04 +0000</pubDate> 
<guid>https://jackxiang.com/post/5449/#blogcomment63788</guid> 
<description>
<![CDATA[ 
	不错的说啊。。
]]>
</description>
</item>
</channel>
</rss>