[PHP] nested functions

2001-05-15 Thread Johannes Schmiderer

Is there no way to access the $x within the inner function:

 function outer()
 {
  $x = 50;
  function inner()
  {
   echo $x;
  }

  inner();
 }

Global in the inner function does not work. I do not want to have $x global
for all.

Hannes Schmiderer




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] time getdate GMT

2001-05-14 Thread Johannes Schmiderer

Hi,

I'm new to PHP. I want to have the GMT Time in extra values (for instance a
array with year, mon, day, hour, )
The best way I've found is:

  $idtGMTime = time() - date("Z");
  $aGMTime = getdate($idtGMTime);

Any other suggestions?
Why isn't there a function like getgmdate() (as gmtime() in Perl).

Note: PHP 4.0.4 Win32 CGI returns a wrong sign for date("Z"). At 4.0.5 it's
ok. 4.0.4pl1 mod_PHP is correct, too.

Hannes Schmiderer





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]