Shadab Wadiwala wrote:
Hi, community !!
Can somebody make me understand what is the difference between the
CONSTANT and the GLOBAL VARIABLE ??
A constant is a value that never changes, whereas a variable can change
its value (which means that there cannot be something like a "constant
variable" or a "variable constant", similar to a "variable datum", which
is also an oxymoron).
A global variable is one that is available in any context (any script
and any function even when not explicitly declared in that one).
Examples: the constant M_PI has the value of pi. No matter what you do,
M_PI does not change its value. You can also use the function pi() to
have the value of M_PI returned.
You can use the PHP keyword global to make any variable to have global
scope. Some variables are global per definition and are called the
superglobals, such as $_SERVER or $_SESSION.
Hope that helps,
David
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php