You are here: Re: All Monday's & Thursdays « All PHP « IT news, forums, messages
Re: All Monday's & Thursdays

Posted by Janwillem Borleffs on 06/30/06 19:28

malcolm wrote:
> Here's antoher attempt;
>
> <?php
> $day = date('D', $ts = strtotime('thursday', $ts));
>

The line numbering is off, but I suspect that the problem is here again (not
initializing $ts before first use), which might cause strtotime to return -1
on your system.

> I find that the code 'Lost' posted in this thread works fine,
> I am only curious about this, thanks for your indulgence.
>

Lost's code is the straightforward way, simply increasing the days until the
end of the month is reached and picking out the Modays and Thursdays. The
code I suggested to the OP is more efficient, because it jumps right to the
Mondays and Thursdays, skipping in between days.

However, the use of strtotime appears to be less portable, and I do share
your curiousity regarding the error message it triggers.


JW

 

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

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