3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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")); ?>
based on CiDql
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.3.0alpha1
Array ( [0] => Array ( [first_name] => hello ) [1] => Array ( [last_name] => hello ) [2] => Array ( [email] => hello ) [3] => Array ( [phone] => hello ) [4] => Array ( [address] => hello ) ) Array ( [first_name] => <b>hello</b> [last_name] => <i>hello</i> [email] => \hello [phone] => he\llo [address] => <h1>hello</h1> )