php doesn't support automatic dereferencing of arrays, so you can't just
throw the index on the back, but you could do this:

$julianday = array_slice(localtime(),7,1);

but then $julianday's an array...so you could wrap an array_pop around
that......although it gets you your val in one line, i think it many cases,
it's easier/better/more efficient to just grab the array in one line, then
access and copy the val in the second line, as you did...

jack
-----Original Message-----
From: John A. Grant [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 05, 2001 5:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP] accessing localtime array directly


In Perl I have done this:
    $julianday=(localtime)[7];

Is there an equivalent syntax for PHP or do I just do:
    $now=localtime();
    $julianday=$now[7];

I don't need it - I'm just curious about the syntax.

--
John A. Grant  * I speak only for myself *  (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here




--
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 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]

Reply via email to