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? Quote 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 Quote 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>'; Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.