Your thoughts, it works in 4 lines of code.
Can we shorten it, without regex?
PHP Code:
$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[2]);
echo $arrayB[0]; //ext result com or whatever ext it is
//if i want the . i can just do
echo ".".$arrayB[0];