Re: Help with associative array in a PHP class. Not working as I'd expect it to?!
| From: | John W. Holmes | Date: | Thu, 11 Dec 2003 02:53:34 +0000 |
| Subject: | Re: Help with associative array in a PHP class. Not working as I'd expect it to?! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172425@lists.php.net to get a copy of this message | ||
Daevid Vincent wrote:
myPacket: ------ How come I don't get ANY array under "myPacket:"? [snip]
function printMyVars()
{
echo "myPacket:\n";
print_r($myPacket);
}
Two words: Variable Scope. :)
$myPacket is local to the function and empty.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com