Need you help in an unusal situation. I need to trim all the $_POST variables.
Is there any way I can do it at a single shot i.e., using a single function?
I
use array_walk with a custom function
array_walk
$clean_values = array(); array_walk($_POST, 'sanitize_post'); function sanitize_post($item, $key) { $clean_values[$key] = trim($item); //optional further cleaning ex) htmlentities }