|
Posted by "Richard Lynch" on 09/30/23 11:31
On Sat, November 5, 2005 3:44 am, shining wrote:
> I am php beginner, I have a question:
> 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.
global only really makes sense in the context of INSIDE a function (or
method of a class)
So *where* did you declare it global?
You probably want to take out the global unless it is inside of a
function() { }
> So I want to ask:
> 1. Is my use way right?
> 2. if I want to track a variable value how it changed between php
> functions,
> besides I print out it's value, Is there any other way to do it?
There are IDEs you can use to watch variables as a script executes.
Zend IDE
Komodo
are the ones I remember as "good" from when I last looked at IDEs
YMMV
--
Like Music?
http://l-i-e.com/artists.htm
Navigation:
[Reply to this message]
|