RE: [PHP] Default setting garbage
| From: | John W. Holmes | Date: | Wed, 26 Mar 2003 01:05:58 +0000 |
| Subject: | RE: [PHP] Default setting garbage | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141044@lists.php.net to get a copy of this message | ||
> Why is it that when I send call this function:
> function GetNextDate($whichfriday, $month = "", $frequency = 1,
$basedate
> = "")
>
> with this line:
> GetNextDate("4", "2003-03", "5");
>
> that $frequency ends up ""? Whether I set it myself when I call the
> function, or I leave it blank and let the function set it itself, it
ends
> up with nothing in it. empty() returns 1, while isset() returns
nothing on
> this.
I'll guess that you're trying to access $frequency outside of the
function, after you've called it, right? If so, read up on variable
scope in the manual.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/