- stripslashes: documentation ( source)
- print_r: documentation ( source)
- strip_tags: documentation ( source)
- array_filter: documentation ( source)
- array_walk_recursive: documentation ( source)
<?php
$data_billding= array(
'first_name' => "<b>hello</b>",
'last_name' => "<i>hello</i>",
'email' => "\hello",
'phone' => "he\llo",
'address' => "<h1>hello</h1>",
);
function change($value, $key){
$key = stripslashes(strip_tags($key));
$value = stripslashes(strip_tags($value));
global $a;
$a[] = array($key => $value);
//print_r($a);
}
array_walk_recursive($data_billding, "change");
print_r($a);
function my_function($value){
return stripslashes(strip_tags($value));
}
/*trả về array chứa value nếu hàm my_function trả về TRUe*/
print_r(array_filter($data_billding,"my_function"));
?>