Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function trim_r($array) {
- if (is_string($array)) {
- return trim($array);
- } else if (!is_array($array)) {
- return '';
- }
- foreach ($array as $key => $value) {
- if ( is_array($value) ) {
- $array[$key] = trim_r($value);
- } else if ( is_string($value) ) {
- $array[$key] = trim($value);
- }
- }
- return $array;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement