3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sweet = ['a' => 'apple ', 'b' => ' "banana" ']; $array = ['sweet' => $sweet, 'test' => " <a href='test'>Test</a>"]; function mySanitizer(&$value) { $value = htmlspecialchars(trim($value)); } array_walk_recursive($array, 'mySanitizer'); var_export($array);

preferences:
27.15 ms | 407 KiB | 5 Q