Your thoughts, it works in 4 lines of code.
Can we shorten it, without regex?
$testurl = strtolower($_SERVER['HTTP_REFERER']);
$arrayA = explode(".", $testurl); //break it up by .
// just in case there is a sub domain,
then do a second array to clear that out and just leave ext in its own element
$arrayB = explode("/", $arrayA);
echo $arrayB; //ext result com or whatever ext it is
//if i want the . i can just do