|
Posted by Geoff Berrow on 07/08/06 09:43
Message-ID: <MPG.1f19a6cdc255be9a9896c6@news.aardvark.net.au> from Joe
contained the following:
>Nope - couldn't get it to work the way I wanted. <sigh> Pity though. It
>would have been handy for so many things. General meetings of clubs and
>non-profits are often on "third Tuesday", "first Friday" and so on.
I need this too, for folk sessions which are on similar dates. Try
this:
<?php
//set up what you want e.g. 1st Friday
$frequency=1;
$day="Fri";
$count=0;
for($j=7;$j<13;$j++){
$found=false;
$count=0;
for($i=1;$i<31;$i++){
$stamp=mktime( 0, 0, 0, $j, $i, 2006);
if( date("D",$stamp)==$day){
$count++;
if($count==$frequency &&
$stamp>strtotime('now')){
$found=true;
}
}
if($found){
echo date("D F d",$stamp)."<br>";
$found=false;
}
}
}
?>
I need to work on it a little more because some events are of the form,
last friday, which can be either the 4th or 5th Friday in the month.
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
Navigation:
[Reply to this message]
|