I have the following code:
$g_value = 'something'; print "$g_value"; function get_value() { global $g_value; print $g_value; } print get_value();
When I run it in a stand-alone PHP script, I get "somethingsomething". However, when I run it in the WordPress plugin, I only get โsomethingโ - the global declaration does not make var available in the function. I thought this should always work and is independent of register_globals or other environment settings. What's going on here?
Yarin source share