Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Accessing Global Variables with the global Statement

Mon Oct 27, 2008 1:01 pm

Code:

<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>




Post a reply
  Related Posts  to : Accessing Global Variables with the global Statement
 global statement in php     -  
 dynamic array as global variables     -  
 how to call a global variable?     -  
 Dynamically Setting and Accessing Variables     -  
 different between Local variable and Global variable     -  
 difference between break statement and a continue statement     -  
 Local variables vs Instance variables     -  
 difference between a while statement and a do statement     -  
 php Accessing a Property from Within a Method     -  
 update an xml file with jaxb and accessing to its elements     -  

Topic Tags

PHP Variables