maxudaskin Posted February 3, 2008 Share Posted February 3, 2008 What is the difference between ___? echo & print while & do die & exit define(blah,blah) & $blah = blah And any others that may be confusing... Quote Link to comment https://forums.phpfreaks.com/topic/89149-solved-what-is-the-difference/ Share on other sites More sharing options...
ratcateme Posted February 3, 2008 Share Posted February 3, 2008 echo read this http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40 do checks the expression at the end instead of the begin not much between exit and die i don't really use define but it assigns case insensitively check this http://nz2.php.net/define Scott. Quote Link to comment https://forums.phpfreaks.com/topic/89149-solved-what-is-the-difference/#findComment-456554 Share on other sites More sharing options...
p2grace Posted February 3, 2008 Share Posted February 3, 2008 define is a global variable. You can call it within classes, functions, and pages without having to global it. Quote Link to comment https://forums.phpfreaks.com/topic/89149-solved-what-is-the-difference/#findComment-456555 Share on other sites More sharing options...
trq Posted February 3, 2008 Share Posted February 3, 2008 All these questions are answered in the manual if you look, but here we go.... The only difference between print and echo is that echo excepts multiple arguments. While evaluates the expression prior to executing the first time, do does not. Nothing The define function creates constants, not variables. Quote Link to comment https://forums.phpfreaks.com/topic/89149-solved-what-is-the-difference/#findComment-456556 Share on other sites More sharing options...
maxudaskin Posted February 3, 2008 Author Share Posted February 3, 2008 If a constant is retrieved the same way as a variable what is the difference between the two? Quote Link to comment https://forums.phpfreaks.com/topic/89149-solved-what-is-the-difference/#findComment-456561 Share on other sites More sharing options...
ratcateme Posted February 3, 2008 Share Posted February 3, 2008 the fact you can get them from a function without having to call it specially i think. Quote Link to comment https://forums.phpfreaks.com/topic/89149-solved-what-is-the-difference/#findComment-456565 Share on other sites More sharing options...
trq Posted February 3, 2008 Share Posted February 3, 2008 As the name implies, they are constant not variable. Meaning they cannot be changed. And yes, they are also avaliable globally. Quote Link to comment https://forums.phpfreaks.com/topic/89149-solved-what-is-the-difference/#findComment-456572 Share on other sites More sharing options...
maxudaskin Posted February 3, 2008 Author Share Posted February 3, 2008 Can you call <?php define("GREETING","Hello you! How are you today?"); echo $GREETING; ?> Quote Link to comment https://forums.phpfreaks.com/topic/89149-solved-what-is-the-difference/#findComment-456868 Share on other sites More sharing options...
trq Posted February 3, 2008 Share Posted February 3, 2008 That would be.... <?php define("GREETING","Hello you! How are you today?"); echo GREETING; ?> Quote Link to comment https://forums.phpfreaks.com/topic/89149-solved-what-is-the-difference/#findComment-456873 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.