Accessing Global Variables with the global Statement
<html> <head> <title>Accessing Global Variables with the global Statement</title> </head> <body> <?php $life=42; function meaningOfLife() { global $life; print "The meaning of life is $life<br>"; } meaningOfLife(); ?> </body> </html>