復(fù)制代碼 代碼如下:
function quotes($content)
{
//如果magic_quotes_gpc=Off,那么就開始處理
if (!get_magic_quotes_gpc()) {
//判斷$content是否為數(shù)組
if (is_array($content)) {
//如果$content是數(shù)組,那么就處理它的每一個單無
foreach ($content as $key=>$value) {
$content[$key] = addslashes($value);
}
} else {
//如果$content不是數(shù)組,那么就僅處理一次
addslashes($content);
}
} else {
//如果magic_quotes_gpc=On,那么就不處理
}
//返回$content
return $content;
|
新聞熱點
疑難解答