/ Published in: PHP
Expand |
Embed | Plain Text
/* reduces multiple spaces to a single one in strings or arrays Usage: $result = spaces2space($variable); */ function spaces2space($variable) { return (!is_array($variable)) ? preg_replace('/\s\s+/', ' ', $variable) : array_map('spaces2space',$variable); }
You need to login to post a comment.
