- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$referer = 'http://chameleon.online.dev/documents/orders/';
// Извлекаем имя хоста из URL
preg_match('@^(http://[.*]/)?.*@i',
$referer, $matches);
$host = $matches;
var_dump($host);