PHP – How to trim all values in arrayBoring way:for($i = 0; $i < count($arr); $i++){ $arr[$i] = trim($arr[$i]); }The right way:$arr = array_map('trim', $arr);This will call function trim on every value in array $arr.
Webmentions
[…] + Read More […]
[…] + Read More Here […]