Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function trim_r($array) {
  2. if (is_string($array)) {
  3. return trim($array);
  4. } else if (!is_array($array)) {
  5. return '';
  6. }
  7. foreach ($array as $key => $value) {
  8. if ( is_array($value) ) {
  9. $array[$key] = trim_r($value);
  10. } else if ( is_string($value) ) {
  11. $array[$key] = trim($value);
  12. }
  13. }
  14. return $array;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement