Loading ...
Sorry, an error occurred while loading the content.

function logic

Expand Messages
  • carroll cole
    I am trying to write a php function that will count the number of mondays in a time period given two dates or a month like april. can someone help me with the
    Message 1 of 12 , Dec 14, 2005
    • 0 Attachment
      I am trying to write a php function that will count the number of mondays
      in a time period given two dates or a month like april.

      can someone help me with the logic
    • Hassan Voyeau
      An easy way to do this would be to check each date from start date to end date and increment your counter if it is a Monday. ... mondays
      Message 2 of 12 , Dec 14, 2005
      • 0 Attachment
        An easy way to do this would be to check each date from start date to
        end date and increment your counter if it is a Monday.

        --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...> wrote:
        >
        > I am trying to write a php function that will count the number of
        mondays
        > in a time period given two dates or a month like april.
        >
        > can someone help me with the logic
        >
      • Hassan Voyeau
        And you can make this more efficient by 1) once you reach a date that is monday you can start incrementing the date by 7 now (since you know that the next
        Message 3 of 12 , Dec 14, 2005
        • 0 Attachment
          And you can make this more efficient by
          1) once you reach a date that is monday you can start incrementing the
          date by 7 now (since you know that the next monday is 7 days away, no
          need to the check the days in between).

          2) then you can eliminate the need to keep checking each Monday by
          incrementing your date to the last Monday before the end date. (First
          Monday - End Date/7)*7.

          --- In TTLUG@yahoogroups.com, "Hassan Voyeau" <hassan.voyeau@g...>
          wrote:
          >
          > An easy way to do this would be to check each date from start date to
          > end date and increment your counter if it is a Monday.
          >
          > --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...> wrote:
          > >
          > > I am trying to write a php function that will count the number of
          > mondays
          > > in a time period given two dates or a month like april.
          > >
          > > can someone help me with the logic
          > >
          >
        • Gerard Matthew
          Below is the basic idea... function countMondays($from_date, $to_date) { $count = ( date( l ,strtotime( $from_date ) ) == Monday ) ? 1: 0; for ($i =
          Message 4 of 12 , Dec 14, 2005
          • 0 Attachment
            Below is the basic idea...

            function countMondays($from_date, $to_date) {

            $count = ( date('l',strtotime("$from_date") ) == "Monday") ? 1: 0;

            for ($i = strtotime("$from_date"); $i <= strtotime($to_date); $i =
            strtotime("next Monday",$i) ) {
            $count++;
            }

            return $count;
            }

            Rgds,
            Gerard.

            On 12/14/05, carroll cole <ccole@...> wrote:
            >
            > I am trying to write a php function that will count the number of mondays
            >
            > in a time period given two dates or a month like april.
            >
            > can someone help me with the logic
            >
            >
            >
            > Help build TTLUG by forwarding this to anyone who is interested in the
            > subject matter or would otherwise benefit from joining the mailing list.
            >
            > Trinidad and Tobago Linux Users Group http://groups.yahoo.com/group/ttlug
            > To subscribe, send an email to_______ TTLUG-subscribe@yahoogroups.com
            > To unsubscribe, send an email to_____ TTLUG-unsubscribe@yahoogroups.com
            > List owner/moderator Richard Jobity__ TTLUG-owner@yahoogroups.com
            >
            >
            >
            >
            > SPONSORED LINKS
            > Linux software<http://groups.yahoo.com/gads?t=ms&k=Linux+software&w1=Linux+software&w2=Linux+operating+system&w3=Hosting+linux+unix+web&w4=Free+linux+operating+system&w5=Unix+operating+system&w6=Linux+user&c=6&s=152&.sig=5gudNiEXUDZA27GwC3z3Jw> Linux
            > operating system<http://groups.yahoo.com/gads?t=ms&k=Linux+operating+system&w1=Linux+software&w2=Linux+operating+system&w3=Hosting+linux+unix+web&w4=Free+linux+operating+system&w5=Unix+operating+system&w6=Linux+user&c=6&s=152&.sig=sGDkboFy8FD3xekAV2uB4w> Hosting
            > linux unix web<http://groups.yahoo.com/gads?t=ms&k=Hosting+linux+unix+web&w1=Linux+software&w2=Linux+operating+system&w3=Hosting+linux+unix+web&w4=Free+linux+operating+system&w5=Unix+operating+system&w6=Linux+user&c=6&s=152&.sig=sxcWiZmDbeVl6L6ByWGVdQ> Free
            > linux operating system<http://groups.yahoo.com/gads?t=ms&k=Free+linux+operating+system&w1=Linux+software&w2=Linux+operating+system&w3=Hosting+linux+unix+web&w4=Free+linux+operating+system&w5=Unix+operating+system&w6=Linux+user&c=6&s=152&.sig=UKLREfNjlUPXfD2u9tBSOg> Unix
            > operating system<http://groups.yahoo.com/gads?t=ms&k=Unix+operating+system&w1=Linux+software&w2=Linux+operating+system&w3=Hosting+linux+unix+web&w4=Free+linux+operating+system&w5=Unix+operating+system&w6=Linux+user&c=6&s=152&.sig=Y0pCSzp7QCovTXy0p61Wiw> Linux
            > user<http://groups.yahoo.com/gads?t=ms&k=Linux+user&w1=Linux+software&w2=Linux+operating+system&w3=Hosting+linux+unix+web&w4=Free+linux+operating+system&w5=Unix+operating+system&w6=Linux+user&c=6&s=152&.sig=Y_nb3wzBFx0FuvS5KQl7qQ>
            > ------------------------------
            > YAHOO! GROUPS LINKS
            >
            >
            > - Visit your group "TTLUG <http://groups.yahoo.com/group/TTLUG>" on
            > the web.
            >
            > - To unsubscribe from this group, send an email to:
            > TTLUG-unsubscribe@yahoogroups.com<TTLUG-unsubscribe@yahoogroups.com?subject=Unsubscribe>
            >
            > - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
            > Service <http://docs.yahoo.com/info/terms/>.
            >
            >
            > ------------------------------
            >


            [Non-text portions of this message have been removed]
          • Hassan Voyeau
            Additionally you can scrap the loop logic all together strtotime( start_date -1 days next Monday ) to get the first Monday strtotime( end_date +1 days last
            Message 5 of 12 , Dec 14, 2005
            • 0 Attachment
              Additionally you can scrap the loop logic all together

              strtotime("start_date -1 days next Monday") to get the first Monday
              strtotime("end_date +1 days last Monday") to get the last Monday
              then use ((last_monday - first_monday)/7)*7 + 1

              I don't think you could get more efficient than that

              --- In TTLUG@yahoogroups.com, "Hassan Voyeau" <hassan.voyeau@g...>
              wrote:
              >
              > And you can make this more efficient by
              > 1) once you reach a date that is monday you can start incrementing
              the
              > date by 7 now (since you know that the next monday is 7 days away,
              no
              > need to the check the days in between).
              >
              > 2) then you can eliminate the need to keep checking each Monday by
              > incrementing your date to the last Monday before the end date.
              (First
              > Monday - End Date/7)*7.
              >
              > --- In TTLUG@yahoogroups.com, "Hassan Voyeau" <hassan.voyeau@g...>
              > wrote:
              > >
              > > An easy way to do this would be to check each date from start
              date to
              > > end date and increment your counter if it is a Monday.
              > >
              > > --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...> wrote:
              > > >
              > > > I am trying to write a php function that will count the number
              of
              > > mondays
              > > > in a time period given two dates or a month like april.
              > > >
              > > > can someone help me with the logic
              > > >
              > >
              >
            • Hassan Voyeau
              ... wrote: Correction : floor((last_monday - first_monday)/(7*86400)) + 1 if first_monday last_monday then answer is 0. I have downloaded PHP so I could
              Message 6 of 12 , Dec 14, 2005
              • 0 Attachment
                --- In TTLUG@yahoogroups.com, "Hassan Voyeau" <hassan.voyeau@g...>
                wrote:
                Correction : floor((last_monday - first_monday)/(7*86400)) + 1
                if first_monday > last_monday then answer is 0.

                I have downloaded PHP so I could actually write the code and test it.
                The final solution in PHP would be @
                http://haveworld.blogspot.com/2005/12/php-tip-mondays-between-2-
                dates.html

                > Additionally you can scrap the loop logic all together
                >
                > strtotime("start_date -1 days next Monday") to get the first Monday
                > strtotime("end_date +1 days last Monday") to get the last Monday
                > then use ((last_monday - first_monday)/7)*7 + 1
                >
                > I don't think you could get more efficient than that
                >
                > --- In TTLUG@yahoogroups.com, "Hassan Voyeau" <hassan.voyeau@g...>
                > wrote:
                > >
                > > And you can make this more efficient by
                > > 1) once you reach a date that is monday you can start
                incrementing
                > the
                > > date by 7 now (since you know that the next monday is 7 days
                away,
                > no
                > > need to the check the days in between).
                > >
                > > 2) then you can eliminate the need to keep checking each Monday
                by
                > > incrementing your date to the last Monday before the end date.
                > (First
                > > Monday - End Date/7)*7.
                > >
                > > --- In TTLUG@yahoogroups.com, "Hassan Voyeau"
                <hassan.voyeau@g...>
                > > wrote:
                > > >
                > > > An easy way to do this would be to check each date from start
                > date to
                > > > end date and increment your counter if it is a Monday.
                > > >
                > > > --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...> wrote:
                > > > >
                > > > > I am trying to write a php function that will count the
                number
                > of
                > > > mondays
                > > > > in a time period given two dates or a month like april.
                > > > >
                > > > > can someone help me with the logic
                > > > >
                > > >
                > >
                >
              • carroll cole
                thanks it worked perfectly i just had to take the +1 out from the line below
                Message 7 of 12 , Dec 14, 2005
                • 0 Attachment
                  thanks it worked perfectly i just had to take the +1 out from the line below

                  >--- In TTLUG@yahoogroups.com, "Hassan Voyeau" <hassan.voyeau@g...>
                  >wrote:
                  >Correction : floor((last_monday - first_monday)/(7*86400)) + 1
                  >if first_monday > last_monday then answer is 0.
                  >
                  >I have downloaded PHP so I could actually write the code and test it.
                  >The final solution in PHP would be @
                  >http://haveworld.blogspot.com/2005/12/php-tip-mondays-between-2-
                  >dates.html
                  >
                  > > Additionally you can scrap the loop logic all together
                  > >
                  > > strtotime("start_date -1 days next Monday") to get the first Monday
                  > > strtotime("end_date +1 days last Monday") to get the last Monday
                  > > then use ((last_monday - first_monday)/7)*7 + 1
                  > >
                  > > I don't think you could get more efficient than that
                  > >
                  > > --- In TTLUG@yahoogroups.com, "Hassan Voyeau" <hassan.voyeau@g...>
                  > > wrote:
                  > > >
                  > > > And you can make this more efficient by
                  > > > 1) once you reach a date that is monday you can start
                  >incrementing
                  > > the
                  > > > date by 7 now (since you know that the next monday is 7 days
                  >away,
                  > > no
                  > > > need to the check the days in between).
                  > > >
                  > > > 2) then you can eliminate the need to keep checking each Monday
                  >by
                  > > > incrementing your date to the last Monday before the end date.
                  > > (First
                  > > > Monday - End Date/7)*7.
                  > > >
                  > > > --- In TTLUG@yahoogroups.com, "Hassan Voyeau"
                  ><hassan.voyeau@g...>
                  > > > wrote:
                  > > > >
                  > > > > An easy way to do this would be to check each date from start
                  > > date to
                  > > > > end date and increment your counter if it is a Monday.
                  > > > >
                  > > > > --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...> wrote:
                  > > > > >
                  > > > > > I am trying to write a php function that will count the
                  >number
                  > > of
                  > > > > mondays
                  > > > > > in a time period given two dates or a month like april.
                  > > > > >
                  > > > > > can someone help me with the logic
                  > > > > >
                  > > > >
                  > > >
                  > >
                  >
                • Hassan Voyeau
                  Did you test with both dates being equal? Please take a look at my final solution @ http://haveworld.blogspot.com/2005/12/php-tip- mondays-between-2-dates.html
                  Message 8 of 12 , Dec 14, 2005
                  • 0 Attachment
                    Did you test with both dates being equal? Please take a look at my
                    final solution @ http://haveworld.blogspot.com/2005/12/php-tip-
                    mondays-between-2-dates.html

                    --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...> wrote:
                    >
                    > thanks it worked perfectly i just had to take the +1 out from the
                    line below
                    >
                    > >--- In TTLUG@yahoogroups.com, "Hassan Voyeau" <hassan.voyeau@g...>
                    > >wrote:
                    > >Correction : floor((last_monday - first_monday)/(7*86400)) + 1
                    > >if first_monday > last_monday then answer is 0.
                    > >
                    > >I have downloaded PHP so I could actually write the code and test
                    it.
                    > >The final solution in PHP would be @
                    > >http://haveworld.blogspot.com/2005/12/php-tip-mondays-between-2-
                    > >dates.html
                    > >
                    > > > Additionally you can scrap the loop logic all together
                    > > >
                    > > > strtotime("start_date -1 days next Monday") to get the first
                    Monday
                    > > > strtotime("end_date +1 days last Monday") to get the last Monday
                    > > > then use ((last_monday - first_monday)/7)*7 + 1
                    > > >
                    > > > I don't think you could get more efficient than that
                    > > >
                    > > > --- In TTLUG@yahoogroups.com, "Hassan Voyeau"
                    <hassan.voyeau@g...>
                    > > > wrote:
                    > > > >
                    > > > > And you can make this more efficient by
                    > > > > 1) once you reach a date that is monday you can start
                    > >incrementing
                    > > > the
                    > > > > date by 7 now (since you know that the next monday is 7 days
                    > >away,
                    > > > no
                    > > > > need to the check the days in between).
                    > > > >
                    > > > > 2) then you can eliminate the need to keep checking each
                    Monday
                    > >by
                    > > > > incrementing your date to the last Monday before the end date.
                    > > > (First
                    > > > > Monday - End Date/7)*7.
                    > > > >
                    > > > > --- In TTLUG@yahoogroups.com, "Hassan Voyeau"
                    > ><hassan.voyeau@g...>
                    > > > > wrote:
                    > > > > >
                    > > > > > An easy way to do this would be to check each date from
                    start
                    > > > date to
                    > > > > > end date and increment your counter if it is a Monday.
                    > > > > >
                    > > > > > --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...>
                    wrote:
                    > > > > > >
                    > > > > > > I am trying to write a php function that will count the
                    > >number
                    > > > of
                    > > > > > mondays
                    > > > > > > in a time period given two dates or a month like april.
                    > > > > > >
                    > > > > > > can someone help me with the logic
                    > > > > > >
                    > > > > >
                    > > > >
                    > > >
                    > >
                    >
                  • Raul Bermudez
                    Can you subtract the dates and divide into seven? (+ or - 1) --
                    Message 9 of 12 , Dec 14, 2005
                    • 0 Attachment
                      Can you subtract the dates and divide into seven? (+ or - 1)

                      --

                      >
                      > From: "Hassan Voyeau" <hassan.voyeau@...>
                      > Reply-To: TTLUG@yahoogroups.com
                      > Date: Wed, 14 Dec 2005 15:59:33 -0000
                      > To: TTLUG@yahoogroups.com
                      > Subject: [TTLUG] Re: function logic
                      >
                      > An easy way to do this would be to check each date from start date to
                      > end date and increment your counter if it is a Monday.
                      >
                    • Raul Bermudez
                      Sorry, I now realize that I came in after the hard work was done. --
                      Message 10 of 12 , Dec 14, 2005
                      • 0 Attachment
                        Sorry, I now realize that I came in after the hard work was done.

                        --

                        >
                        > From: Raul Bermudez <toymaker@...>
                        > Reply-To: TTLUG@yahoogroups.com
                        > Date: Wed, 14 Dec 2005 19:46:22 -0400
                        > To: TTLUG list <TTLUG@yahoogroups.com>
                        > Subject: Re: [TTLUG] Re: function logic
                        >
                        > Can you subtract the dates and divide into seven? (+ or - 1)
                        >
                        >>
                        >> From: "Hassan Voyeau" <hassan.voyeau@...>
                        >> Reply-To: TTLUG@yahoogroups.com
                        >> Date: Wed, 14 Dec 2005 15:59:33 -0000
                        >> To: TTLUG@yahoogroups.com
                        >> Subject: [TTLUG] Re: function logic
                        >>
                        >> An easy way to do this would be to check each date from start date to
                        >> end date and increment your counter if it is a Monday.
                        >>
                      • carroll cole
                        I changed the line return floor(($last_date - $first_date)/(7*86400)) +1; to return floor(($last_date - $first_date)/(7*86400)); because it was consistently
                        Message 11 of 12 , Dec 15, 2005
                        • 0 Attachment
                          I changed the line

                          return floor(($last_date - $first_date)/(7*86400)) +1;
                          to
                          return floor(($last_date - $first_date)/(7*86400));

                          because it was consistently overstating the number of mondays by 1.

                          I checked the function with the following data:

                          1) Jan 1 2005 to Dec 31 2005
                          2) Nov 1 2005 to Dec 31 2005
                          3) Dec 29 2005 to Jan 4 2006
                          4) Dec 20 2005 to Dec 20 2005
                          5) Dec 26 2005 to Dec 26 2005

                          In cases 1 - 3 the right answer was returned. Cases 4 and 5 returned 0
                          mondays. It seems that it cannot calculate periods less than 7 days. For
                          my needs the smallest period would be a week so I noted it in the
                          documentation and continued.

                          I also modified the function with the following;

                          if (checkdate($start_date) || checkdate($end_date))
                          continue
                          else
                          return -1

                          to keep out the most common type of error

                          Thanks


                          >Did you test with both dates being equal? Please take a look at my
                          >final solution @ http://haveworld.blogspot.com/2005/12/php-tip-
                          >mondays-between-2-dates.html
                          >
                          >--- In TTLUG@yahoogroups.com, carroll cole <ccole@s...> wrote:
                          > >
                          > > thanks it worked perfectly i just had to take the +1 out from the
                          >line below
                          > >
                          > > >--- In TTLUG@yahoogroups.com, "Hassan Voyeau" <hassan.voyeau@g...>
                          > > >wrote:
                          > > >Correction : floor((last_monday - first_monday)/(7*86400)) + 1
                          > > >if first_monday > last_monday then answer is 0.
                          > > >
                          > > >I have downloaded PHP so I could actually write the code and test
                          >it.
                          > > >The final solution in PHP would be @
                          > > >http://haveworld.blogspot.com/2005/12/php-tip-mondays-between-2-
                          > > >dates.html
                          > > >
                          > > > > Additionally you can scrap the loop logic all together
                          > > > >
                          > > > > strtotime("start_date -1 days next Monday") to get the first
                          >Monday
                          > > > > strtotime("end_date +1 days last Monday") to get the last Monday
                          > > > > then use ((last_monday - first_monday)/7)*7 + 1
                          > > > >
                          > > > > I don't think you could get more efficient than that
                          > > > >
                          > > > > --- In TTLUG@yahoogroups.com, "Hassan Voyeau"
                          ><hassan.voyeau@g...>
                          > > > > wrote:
                          > > > > >
                          > > > > > And you can make this more efficient by
                          > > > > > 1) once you reach a date that is monday you can start
                          > > >incrementing
                          > > > > the
                          > > > > > date by 7 now (since you know that the next monday is 7 days
                          > > >away,
                          > > > > no
                          > > > > > need to the check the days in between).
                          > > > > >
                          > > > > > 2) then you can eliminate the need to keep checking each
                          >Monday
                          > > >by
                          > > > > > incrementing your date to the last Monday before the end date.
                          > > > > (First
                          > > > > > Monday - End Date/7)*7.
                          > > > > >
                          > > > > > --- In TTLUG@yahoogroups.com, "Hassan Voyeau"
                          > > ><hassan.voyeau@g...>
                          > > > > > wrote:
                          > > > > > >
                          > > > > > > An easy way to do this would be to check each date from
                          >start
                          > > > > date to
                          > > > > > > end date and increment your counter if it is a Monday.
                          > > > > > >
                          > > > > > > --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...>
                          >wrote:
                          > > > > > > >
                          > > > > > > > I am trying to write a php function that will count the
                          > > >number
                          > > > > of
                          > > > > > > mondays
                          > > > > > > > in a time period given two dates or a month like april.
                          > > > > > > >
                          > > > > > > > can someone help me with the logic
                          > > > > > > >
                          > > > > > >
                          > > > > >
                          > > > >
                          > > >
                          > >
                        • Hassan Voyeau
                          I would need to see your entire function to see if it covered all cases. ... returned 0 ... days. For ... the ... ... test ... 2- ...
                          Message 12 of 12 , Dec 15, 2005
                          • 0 Attachment
                            I would need to see your entire function to see if it covered all
                            cases.

                            --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...> wrote:
                            >
                            > I changed the line
                            >
                            > return floor(($last_date - $first_date)/(7*86400)) +1;
                            > to
                            > return floor(($last_date - $first_date)/(7*86400));
                            >
                            > because it was consistently overstating the number of mondays by 1.
                            >
                            > I checked the function with the following data:
                            >
                            > 1) Jan 1 2005 to Dec 31 2005
                            > 2) Nov 1 2005 to Dec 31 2005
                            > 3) Dec 29 2005 to Jan 4 2006
                            > 4) Dec 20 2005 to Dec 20 2005
                            > 5) Dec 26 2005 to Dec 26 2005
                            >
                            > In cases 1 - 3 the right answer was returned. Cases 4 and 5
                            returned 0
                            > mondays. It seems that it cannot calculate periods less than 7
                            days. For
                            > my needs the smallest period would be a week so I noted it in the
                            > documentation and continued.
                            >
                            > I also modified the function with the following;
                            >
                            > if (checkdate($start_date) || checkdate($end_date))
                            > continue
                            > else
                            > return -1
                            >
                            > to keep out the most common type of error
                            >
                            > Thanks
                            >
                            >
                            > >Did you test with both dates being equal? Please take a look at my
                            > >final solution @ http://haveworld.blogspot.com/2005/12/php-tip-
                            > >mondays-between-2-dates.html
                            > >
                            > >--- In TTLUG@yahoogroups.com, carroll cole <ccole@s...> wrote:
                            > > >
                            > > > thanks it worked perfectly i just had to take the +1 out from
                            the
                            > >line below
                            > > >
                            > > > >--- In TTLUG@yahoogroups.com, "Hassan Voyeau"
                            <hassan.voyeau@g...>
                            > > > >wrote:
                            > > > >Correction : floor((last_monday - first_monday)/(7*86400)) + 1
                            > > > >if first_monday > last_monday then answer is 0.
                            > > > >
                            > > > >I have downloaded PHP so I could actually write the code and
                            test
                            > >it.
                            > > > >The final solution in PHP would be @
                            > > > >http://haveworld.blogspot.com/2005/12/php-tip-mondays-between-
                            2-
                            > > > >dates.html
                            > > > >
                            > > > > > Additionally you can scrap the loop logic all together
                            > > > > >
                            > > > > > strtotime("start_date -1 days next Monday") to get the first
                            > >Monday
                            > > > > > strtotime("end_date +1 days last Monday") to get the last
                            Monday
                            > > > > > then use ((last_monday - first_monday)/7)*7 + 1
                            > > > > >
                            > > > > > I don't think you could get more efficient than that
                            > > > > >
                            > > > > > --- In TTLUG@yahoogroups.com, "Hassan Voyeau"
                            > ><hassan.voyeau@g...>
                            > > > > > wrote:
                            > > > > > >
                            > > > > > > And you can make this more efficient by
                            > > > > > > 1) once you reach a date that is monday you can start
                            > > > >incrementing
                            > > > > > the
                            > > > > > > date by 7 now (since you know that the next monday is 7
                            days
                            > > > >away,
                            > > > > > no
                            > > > > > > need to the check the days in between).
                            > > > > > >
                            > > > > > > 2) then you can eliminate the need to keep checking each
                            > >Monday
                            > > > >by
                            > > > > > > incrementing your date to the last Monday before the end
                            date.
                            > > > > > (First
                            > > > > > > Monday - End Date/7)*7.
                            > > > > > >
                            > > > > > > --- In TTLUG@yahoogroups.com, "Hassan Voyeau"
                            > > > ><hassan.voyeau@g...>
                            > > > > > > wrote:
                            > > > > > > >
                            > > > > > > > An easy way to do this would be to check each date from
                            > >start
                            > > > > > date to
                            > > > > > > > end date and increment your counter if it is a Monday.
                            > > > > > > >
                            > > > > > > > --- In TTLUG@yahoogroups.com, carroll cole <ccole@s...>
                            > >wrote:
                            > > > > > > > >
                            > > > > > > > > I am trying to write a php function that will count
                            the
                            > > > >number
                            > > > > > of
                            > > > > > > > mondays
                            > > > > > > > > in a time period given two dates or a month like
                            april.
                            > > > > > > > >
                            > > > > > > > > can someone help me with the logic
                            > > > > > > > >
                            > > > > > > >
                            > > > > > >
                            > > > > >
                            > > > >
                            > > >
                            >
                          Your message has been successfully submitted and would be delivered to recipients shortly.