Xu Wei Jie Posted March 13, 2009 Share Posted March 13, 2009 Hi all, I wish to know is there a php construct that is similar to ifdef in other programming languages? Quote Link to comment https://forums.phpfreaks.com/topic/149282-ifdefinesssss/ Share on other sites More sharing options...
Silverado_NL Posted March 13, 2009 Share Posted March 13, 2009 uhm maybe im getting you wrong. but wouldnt IF statements be the tool to use? maybe abit more info would be usefull. Quote Link to comment https://forums.phpfreaks.com/topic/149282-ifdefinesssss/#findComment-783963 Share on other sites More sharing options...
MadTechie Posted March 13, 2009 Share Posted March 13, 2009 I you want the OS the server is running on then you can probably use if(getenv('OS') == "Windows_NT") etc Quote Link to comment https://forums.phpfreaks.com/topic/149282-ifdefinesssss/#findComment-783969 Share on other sites More sharing options...
Xu Wei Jie Posted March 14, 2009 Author Share Posted March 14, 2009 well according to my understanding, ifdef and ifndef are directives that executes conditional group of statements whether a macro is defined or not. For my case, it shall be whether a variable is defined or not. Thus, using ifs seems to equivalent but ifs are more for evaluating boolean expressions. Correct me if I am miss out something here. Quote Link to comment https://forums.phpfreaks.com/topic/149282-ifdefinesssss/#findComment-784392 Share on other sites More sharing options...
Mchl Posted March 14, 2009 Share Posted March 14, 2009 isset Quote Link to comment https://forums.phpfreaks.com/topic/149282-ifdefinesssss/#findComment-784439 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.