Re: How can I track the value in php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> in my index page, I firstly inlcude_once a A.php file, where i defined an
> array, secondly I include another .php file named B.php, where I want to use
> the array, I have claimed it as global type, but it seems I can't retrieve
> any value from the array.

When you include a PHP file, it will be executed in the current
context (AFAIK).  If you're not including it from a function, then it
should be global automatically.  The global keyword makes variables in
functions global.

Maybe this is obvious, but are you sure you have <?php in the B.php?

What does var_dump($xxx); say, if $xxx is the array name?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux