I don't know if it's my code or what, but echo is not showing anything.
<?php
function outside() {
$GLOBALS['variable'] = 'some value';
inside();
}
function inside() {
global $variable;
echo $variable;
}
?>
I don't know if it's my code or what, but echo is not showing anything.
<?php
function outside() {
$GLOBALS['variable'] = 'some value';
inside();
}
function inside() {
global $variable;
echo $variable;
}
?>
You're only defining the functions here. You never actually execute either of them. Try adding:
outside();
after the function definitions.
See it in action here: https://eval.in/79203