PHP Shortest Trim Array recursivly


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /**
  2.  * Trims a entire array recursivly.
  3.  *
  4.  * @author Jonas John
  5.  * @version 0.2
  6.  * @link http://www.jonasjohn.de/snippets/php/trim-array.htm
  7.  * @param array $Input Input array
  8.  */
  9. function TrimArray($Input){
  10. if (!is_array($Input))
  11. return trim($Input);
  12.  
  13. return array_map('TrimArray', $Input);
  14. }

URL: http://www.jonasjohn.de/snippets/php/trim-array.htm

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.