prime Posted October 9, 2007 Share Posted October 9, 2007 I'm trying to find a $_server variable or something that detects what domain the site is on and server_name isn't good since it gives www.site.com, and I need it to just show the site.com I cant seem to find a $server variable that just shows this, is there another way to actually just get this? Link to comment https://forums.phpfreaks.com/topic/72409-just-a-quick-question-on-server-variables/ Share on other sites More sharing options...
prime Posted October 9, 2007 Author Share Posted October 9, 2007 atm I'm using $sitedomain = ereg_replace('www.', '', $_SERVER['SERVER_NAME']); but there's got to be a more elegant way to do this Link to comment https://forums.phpfreaks.com/topic/72409-just-a-quick-question-on-server-variables/#findComment-365190 Share on other sites More sharing options...
Barand Posted October 9, 2007 Share Posted October 9, 2007 for a list of all available server variables echo '<pre>', print_r($_SERVER, true), '</pre>'; Link to comment https://forums.phpfreaks.com/topic/72409-just-a-quick-question-on-server-variables/#findComment-365223 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.