You are here: Re: Second Saturday? « All PHP « IT news, forums, messages
Re: Second Saturday?

Posted by Tony on 07/02/06 16:05

"kenrbnsn" <kenrbnsn@gmail.com> wrote in message
news:1151816630.872688.71210@75g2000cwc.googlegroups.com...
> Joe wrote:
> > My knowledge is poor, but I've been reading a bit and lurking for a
> > while, and I wondered if it were possible to use PHP to display the date
> > for the second Saturday in the current month, or if that has passed, the
> > second Saturday for NEXT month.
>
> You want to look at the time(), strtotime(), and date() functions.
>
> Here is one way:
> <?php
> $today = time();
> $sec_sat = (strtotime('2nd saturday this month') >
> $today)?strtotime('2nd saturday this month'):strtotime('2nd saturday
> next month');
> echo date('l, F j, Y',$sec_sat);
> ?>
>
> Ken


Ken, can you recommend any sites with other various examples such as yours?
Thanks

Tony

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация