Re: getdate( time() ) array use
| From: | Lars Torben Wilson | Date: | Thu, 19 Oct 2000 00:40:04 +0000 |
| Subject: | Re: getdate( time() ) array use | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21030@lists.php.net to get a copy of this message | ||
Bob Hartung writes:
> Okay,
> I am brand new to php with php4 installed. I am having a
> touch time with the getdate( time() ) function. I can place
> this in a variable and then loop through by making it a hash
> but how can I reference just one of the items - say
> "weekday"
>
> $dateInfo = getdate( time() );
>
> why can't I then
>
> print( dateInfo("weekday") ); ## to print the
^^^^^^^^^^^
'cause that's a function call, not an array index.
print($dateInfo['weekday']);
will do what you want.
Good luck,
Torben
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+