PHP Programing language

How Can Using Global Key Word in Function
Previous Home Next
<html>
<head>
<title>global key word in function</title>
</head>
<body>
<?php
$a = 7;
function test() {
  global $a;
  $a = 100;
}
test();
echo "\$a = $a\n";
?>
  
</body>
</html>

 

Output:

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: