PHP没有在浏览器中显示任何内容[关闭]
问题描述:
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