3v4l.org

run code in 300+ PHP versions simultaneously
<?php $referer = 'http://chameleon.online.dev/documents/orders/'; // Извлекаем имя хоста из URL preg_match('@^http://[.*]/?[.*]@i', $referer, $matches); $host = $matches[1]; var_dump($host);

preferences:
54.35 ms | 402 KiB | 5 Q