3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "Hello world<br> <br>&nbsp; &nbsp; "; $input = preg_replace('/(<br>| |&nbsp;)*$/', '', $string); header('Content-Type: text/plain'); var_dump($input);
Output for 4.3.0 - 7.1.0
string(11) "Hello world"