我正在使用一些 php 函数来保证安全。
function whileToArray($qr)
{
while($rs = mysql_fetch_assoc($qr))
{
$data[] = $rs;
}
$data = array_map('htmlspecialchars_decode',$data);
$data = array_map('htmlentities',$data);
return $data;
}
当我运行这段代码时,我得到了;
Warning: htmlspecialchars_decode() expects parameter 1 to be string, array given in C:\AppServ\www\bigbeng\classes\get.class.php on line 22
Warning: htmlspecialchars_decode() expects parameter 1 to be string, array given in C:\AppServ\www\bigbeng\classes\get.class.php on line 22
打印_r($数据):
Array ( [0] => Array ( [kategori_id] => 1 [kategori_adi] => Spor )
[1] => Array ( [kategori_id] => 2 [kategori_adi] => Siyaset ) )
我如何将这些函数与数组一起使用?