Simplest solution
echo array_slice(explode(".",$_SERVER['HTTP_HOST']),-2,1)[0];
This will show the domain name as "imgur". Change -2,1 to -2,0 (or simply -2) to show the domain as "imgur.com"