How to show the the week date range in for any month ?
Like: 3november-9november ,10nov-16nov so on…
Following a question of Rajiv Kumar on Facebook, I’ve developed a first version of the php function below to get the first and last day of each week of a month. There are four parameters:
- $iYear is the variable for the year
- $iMonth is the numerical representation of the month (1 – 12)
- $sFirstDayOfWeek takes either Monday or Sunday as the first day of the week; default is Monday.
- $bExclusive is a boolean which when true takes only weeks within the chosen month but when false, it allows overlapping to take into account all weeks that are related to the chosen month.
Posted In: PHP, Web Development
dev, howto, php, programming
Leave a Comment