我有一个wordpress主题下面的情况,我想在一个名为navigation.php不能够从PHP
$array_test = array (1,2,3,4);
function func1()
{
global $array_test;
echo "test"; // to ensure that the function has been called
echo $array_test[2]; // this writes nothing, though the function is being called
}
文件中
文件来修改所谓的header.php的访问全局数组功能func1
正在调用中,仍然无法访问$array_test[2]
的值,
您有什么想法吗?
编辑: 我怀疑它是与WordPress或主题的问题,但我不知道 的主题是自由health_care_wp_theme
它适用于Ideone ... http://ideone.com/dsTLY8 – mpyw 2013-05-12 12:19:46
可能的牛逼他的两个文件不包括在一起,没有包含在正确的顺序中,或者变量被覆盖在其中的某处。 – scoota269 2013-05-12 12:22:01
当你转储时''GLOBALS [2]' – 2013-05-12 12:22:04