I'm twiting

访问统计

free counters

PHP递归调用

function daddslashes($string, $force = 0)
{
!defined( ‘MAGIC_QUOTES_GPC’ ) && define( ‘MAGIC_QUOTES_GPC’ , get_magic_quotes_gpc() );

if(!MAGIC_QUOTES_GPC || $force)
{
if(is_array($string))
{
foreach($string as $key => $val)
{
$string[$key] = daddslashes($val, $force);
}
}
else
{
$string = addslashes($string);
}

}

return $string;
}

红色部分写得很帅,绿色的部分我不赞同

改为

defined( ‘MAGIC_QUOTES_GPC’ ) or define( ‘MAGIC_QUOTES_GPC’ , get_magic_quotes_gpc() );

( 0 == MAGIC_QUOTES_GPC ) or $force

更直观

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>