How to use of Global and Local Varible in PHP?

5

<?php
$global_data=”This is global data”;
function show()
{
$global_data=”This is Local data”;
echo “<br>”.$GLOBALS[“global_data”];
echo “<br>”.$global_data;
}
show();
?>

Please follow and like us:
0

Add a Comment

Your email address will not be published. Required fields are marked *