- 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[1];
var_dump($host);