php global范例
Example #1 $GLOBALS 范例
<?php
function test() {
$foo = "local variable";
echo '$foo in global scope: ' . $GLOBALS["foo"] . "\n";
echo '$foo in current scope: ' . $foo . "\n";
}
$foo = "Example content";
test();
?>
以上例程的输出类似于:
$foo in global scope: Example content $foo in current scope: local variable
没有无缘无故的荣耀
赞助我写出更好的博客
赞助我写出更好的博客