3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'foo, bar,leo , light,, seo'; $a = explode(',', $str); $a = array_filter(array_map('trim', $a)); var_dump($a);
Output for 4.3.0 - 7.1.0
array(5) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(3) "leo" [3]=> string(5) "light" [5]=> string(3) "seo" }