[phpa] Re: Problem with $_PHPA

  • From: "Nick Lindridge" <nick@xxxxxxxxxxxxxxxxxxxxx>
  • To: <mk@xxxxxxxxxxxxxxx>
  • Date: Tue, 18 Jun 2002 23:06:11 -0000 ()

Are you display $_PHPA from within a function?

Appologies if you understand this point, but globals need to be
declared as such inside functions.

e,g, in your main file

<?

var_dump($_PHPA);

function x()
{
var_dump($_PHPA);
}

x();

?>

will only output the array once. Function x() will not output anything.
To get at $_PHPA you must import a reference to the global into the
local variables of the function.

e.g.

<?

function x()
{
global $_PHPA;
var_dump($_PHPA);
}

x();

?>

will produce output.

Could this be related to your problem? Drop me a mail off list if
you're still stuck.

nick



------------------------------------------------------------------------
  www.php-accelerator.co.uk           Home of the free PHP Accelerator

To post, send email to phpa@xxxxxxxxxxxxx
To unsubscribe, email phpa-request@xxxxxxxxxxxxx with subject unsubscribe


Other related posts: