3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "ABCDE "; echo trim($string); echo preg_replace('/\s+/', '', $string); echo preg_replace('/\s\s+/', '', $string); echo trim(preg_replace('/[\s\t\n\r\s]+/', '', $string)); echo preg_replace('/~\x{00a0}~siu/', '', $string);
Output for 4.3.0 - 7.1.0
ABCDEABCDEABCDEABCDEABCDE