You are here: Re: HOw to check if day is Saturday? « PHP Programming Language « IT news, forums, messages
Re: HOw to check if day is Saturday?

Posted by Curtis on 11/27/06 10:39

laredotornado@zipmail.com wrote:
> Hi,
>
> I'm using PHP 4.4.4 and I was wondering if anyone knows of a function
> or quick way, given a scalar representation of month (as a number
> between 1 and 12), day, and year (as a four digit number, e.g. 2007),
> how would I tell if that day is a Saturday?
>
> Thanks, - Dave

Or, you could try using strtotime to get the timestamp:

<?php
# if the month, day, and year aren't already in a single scalar, put
them in one
$date = "${month}/${day}/${year}";

$dayOfWeek = date('l', strtotime($date));
?>

 

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

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