mi da errore qui:

$host = explode('.',parse_url($referer)['host']);

per [ inaspettata