bluejay002 Posted June 22, 2010 Share Posted June 22, 2010 Hi to all folks, Is it possible in PHP to create a global server variable just like $_SERVER["SERVER_NAME"]? I was thinking of using this variable without having to access it from a database or a file which would be readily available and faster. Thanks, Jay Link to comment https://forums.phpfreaks.com/topic/205541-creating-a-global-server-variable/ Share on other sites More sharing options...
monkeytooth Posted June 22, 2010 Share Posted June 22, 2010 you can create variables but $_SERVER['SERVER_NAME']; is part of PHP itself, I don't think your going to get a much faster response with anything. But then again you aren't being clear about what your doing or what you want? What does a database or file have to do with the $_SERVER['SERVER_NAME']; ? Link to comment https://forums.phpfreaks.com/topic/205541-creating-a-global-server-variable/#findComment-1075520 Share on other sites More sharing options...
bluejay002 Posted June 22, 2010 Author Share Posted June 22, 2010 Thanks for the fast reply. Well, I am not trying to replace or do anything with $_SERVER['SERVER_NAME']. Its just that I want to create a variable that would be reusable and can be seen by any visitor, just like the one I mention above, Whoever the user is, $_SERVER['SERVER_NAME'] will always be available. I want to make something similar to it. I was somehow avoiding database coz I don't want to be datacentric. Alternatively, I was thinking of using a flat file instead. But before that, I want to go with the option of being able to create a server variable. bluejay, Link to comment https://forums.phpfreaks.com/topic/205541-creating-a-global-server-variable/#findComment-1075522 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.