the answer is simply yes!
You can have a simple for looping to do so.

<?php
// for example, 02/2005
$year = 2005;
$month = 02;

for ($i = 1; $i <= 31 ; $i++) {
 if (checkdate($month,$i,$year)) {
  if (date("w",mktime(0,0,0,$month,$i,$year)) == '0') // it is Sunday
   echo $i . '/' . $month . '/' . $year . "\n";
  if (date("w",mktime(0,0,0,$month,$i,$year)) == '6') // it is Saturday
   echo $i . '/' . $month . '/' . $year . "\n";
 }
}
/** Sample output:
5/2/2005
6/2/2005
12/2/2005
13/2/2005
19/2/2005
20/2/2005
26/2/2005
27/2/2005
**/
?>

hope this help!


""Shaun"" <[EMAIL PROTECTED]> 
wrote:[EMAIL PROTECTED]
> Hi,
>
> Is it possible to get the number of saturdays and sundays for a given 
> month / year?
>
> Thanks for your help. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to