【发布时间】:2010-12-10 18:00:18
【问题描述】:
我在 PHP 中有一个简单的小便清理功能
它接受一个值或值数组并进行一些输入清理。现在我使用 mysqli 将行作为对象获取,因此我需要能够将其应用于对象和数组
function filter_out($output=''){
if($output != ''){
// i.e passed $_POST array
if(is_array($output)){
$newoutput = array();
foreach($output as $outputname=>$outputval){
$newoutput[$outputname] = stripslashes($outputval);
$newoutput[$outputname] = htmlspecialchars($newoutput[$outputname]);
}
} else if(is_object($input)){
?
}
}
}
谁能告诉我如何用对象作为输入来做等效的事情?
【问题讨论】: