PHP Programing language

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