Code sample is not possiable because right now I am away from my desktop, here is a PHP example link. It will give you enough idea about solution http://bytes.com/topic/php/answers/447768-how-do-you-get-list-all-dates-between-two-dates-more-than-day-apart[^]
Share your experience with others Check my Blog...