3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $arr = array('<a>test</a>','&b','c'); class Security { public static function safeArray($array){ array_walk_recursive( $array, function(&$array){ $array = htmlspecialchars(strip_tags($array)); } ); return $array; } } print_r(Security::safeArray($arr));

preferences:
53.37 ms | 402 KiB | 5 Q