3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "ABCDE "; echo trim($string)."\n"; echo preg_replace('/\s+/', '', $string)."\n"; echo preg_replace('/\s\s+/', '', $string)."\n"; echo trim(preg_replace('/[\s\t\n\r\s]+/', '', $string))."\n"; echo preg_replace('/~\x{00a0}~siu/', '', $string);

preferences:
36.11 ms | 402 KiB | 5 Q