3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = array(" Heureka.cz "," Heureka.cz "," Kosmetika a zdravĂ­ "," Kosmetika"); $bez_mezer = array_map('trim', array_filter($text)); var_dump($bez_mezer);
Output for 7.1.25 - 7.1.32, 7.2.0 - 7.2.33, 7.3.0 - 7.3.26, 7.4.0 - 7.4.13, 8.0.0 - 8.0.3
array(4) { [0]=> string(10) "Heureka.cz" [1]=> string(10) "Heureka.cz" [2]=> string(19) "Kosmetika a zdravĂ­" [3]=> string(9) "Kosmetika" }