3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Hello how are you<br>Foo bar hello'; $array = preg_split( '/(?:(?<=\s)\s*|\b)|(<br>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE); var_dump( $array);

preferences:
37.01 ms | 402 KiB | 5 Q