/ Published in: PHP
A function i made for running trim on all elements in an array
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* - function trim_array() - * * A function for quicly triming all variables in an array * */ function trim_array($value) { foreach($value as $name => $item) { // Walk's trou the array $tmp[$name] = trim_array($item); // - We need to trim that one first } else { // Else: } } return $tmp; // Return the trimed versjon of the array }