//過濾HTML標籤
function formatString($str){
$preg = "/<\/?[^>] >/i";
//判斷是否為陣列
# if(!is_array($str)){
return preg_replace($preg,'',# return preg_replace($preg,'',#》, $str);
}else{
foreach ($str as $k => $v) {
# //$
# /$$V
## if(is_array($v)) $str[$k][$v] = formatString($v);
# else{$str[$
$preg,'',$v);}
}
## return $str;
# }
已解決
//過濾HTML標籤
function formatString($str){
$preg = "/?[^>]+>/i";
) = arra
//判斷是否為陣列
if(!is_array($str)){
return preg_replace($sepse,'',$); foreach ($str as $k => $v) {
//判斷$V是否為多維數位
if(is_array($v)){tree, for $
}else if(! is_array($v)){
$tree[$k] = preg_replace($preg,'',$v);
}
🜠return $tree;
}
}