johnsmith153 Posted June 24, 2010 Share Posted June 24, 2010 define('HELLO', 'how are you?'); $hello = "how are you"; echo HELLO; echo $hello define or $ variable, which is better and why would you have both? Link to comment https://forums.phpfreaks.com/topic/205735-define-vs-variable/ Share on other sites More sharing options...
Adam Posted June 24, 2010 Share Posted June 24, 2010 A define AKA a "constant", has a constant value; once defined it cannot be changed. Variables are also only available within the same scope, constants are global. Link to comment https://forums.phpfreaks.com/topic/205735-define-vs-variable/#findComment-1076568 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.