|
Posted by Rik on 08/15/07 19:08
On Wed, 15 Aug 2007 20:45:33 +0200, Toby A Inkster =
<usenet200707@tobyinkster.co.uk> wrote:
> Rik wrote:
>
>> function is_today($timestamp){
>> return date('d',$timestamp) =3D=3D date('d');
>> }
>
> The following will return TRUE:
>
> is_today(strtotime('15 Feb 1986'));
>
> Better would be:
>
> function is_today ($ts)
> { return date('Ymd',$ts)=3D=3Ddate('Ymd'); }
Up it does. Kept it as simple as possible as the op stated it could only=
=
be today or yesterday: hence not a month difference etc.
Then again this will be up for it when the difference _can_ run longer =
indeed.
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|