3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = 'http://roger.shopery.dev/admin/'; $hostName = 'gros.cat'; $pattern = '~//([a-zA-Z0\.-9]+)([:0-9]+)?/(.*)~U'; var_dump( preg_replace( $pattern, "//$hostName$2/", $url ));
Output for 4.3.0 - 7.2.0
string(22) "http://gros.cat/admin/"