3v4l.org

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