How To Trim Whitespace From Exploded Elements In PHP

Published Date Author: , Posted May 7th, 2012 at 10:54:31am

Here is a one-liner that explodes a string and trims whitespace from each element:

$array = array_map('trim',explode(',',$str));

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.