dennismonsewicz Posted September 23, 2009 Share Posted September 23, 2009 can someone explain what the declare statement is used for? I read about it in the PHP manual but I am not fully grasping the concept. http://us2.php.net/manual/en/control-structures.declare.php Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted September 23, 2009 Share Posted September 23, 2009 It's used to make a date a constant meaning it never changes which is available throughout the script without a need to use the global. It's mainly used on config files for you database connection data for example. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 23, 2009 Author Share Posted September 23, 2009 hmmm ok... is it really a helpful function? Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted September 23, 2009 Share Posted September 23, 2009 it can be, I din't use it at all until recently I use it a lot to store things like file paths. Instead if having to pass variables to a functions it's already available. I recommend giving it a try. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 23, 2009 Author Share Posted September 23, 2009 but how does this function differe from using the define function? Quote Link to comment Share on other sites More sharing options...
knsito Posted September 23, 2009 Share Posted September 23, 2009 Youre right.. declare() and define() are different I've never used declare() before but the tick option looks useful for debugging or monitoring something. Not really sure how to use the encoding part either.. Maybe someone else can shed some light on this. But this is something you probably woudnt use much, if ever.. but how does this function differe from using the define function? Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted September 23, 2009 Share Posted September 23, 2009 oh sorry I misread your first post I thought you said define when you said declare, I've never used declare. Quote Link to comment 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.