3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $postcode = "HU13 0EG"; $split_postcode = explode(" ",$postcode); var_dump($split_postcode); echo "\n\r"; $split_postcode = $split_postcode[0].' '.preg_replace("/[^0-9]*/","",$split_postcode[1]); var_dump($split_postcode);
Output for 4.3.0 - 7.2.0
array(2) { [0]=> string(4) "HU13" [1]=> string(3) "0EG" } string(6) "HU13 0"