Re: getting variables from other functions

From: Date: Sun, 21 Jul 2002 04:38:18 +0000
Subject: Re: getting variables from other functions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-108692@lists.php.net to get a copy of this message
Jason Wong wrote:
Did you print out $SEARCHMONTH & $SEARCHDAY to see what values they contained? This is a basic debugging technique that everyone should use.
Ah.. yes I see what I did wrong... I had previously printed them out but it was within the function where they **were** defined as global (see my erroneous assumption below)...
If you had did that you will see that they are both empty. Which means that you forgot to declare them as global.
I had the mistaken notion that once a variable had been defined as 'global' in one function that it was then available for the rest of the PHP script. Thanks for the clue TjL

« previous php.general (#108692) next »