3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'foobar, 2&nbsp;foo 3&nbsp;bar'; $string = preg_replace("/\s|&nbsp;/",' ', $string); $output = ucwords($string); print_r($output);

preferences:
40.76 ms | 402 KiB | 5 Q