Grab all Wednesdays in a given month in PHP

前端 未结 11 1685
长发绾君心
长发绾君心 2020-12-09 18:36

This is the function I\'m trying to write:

function getWednesdays($month, $year) {
   // Returns an array of DateTimes representing all Wednesdays this month         


        
11条回答
  •  天命终不由人
    2020-12-09 19:24

    
    

    But I highly recommend getting used to PHP 5.3's date and time functions if you can use them. (See Gordon's answer.)

提交回复
热议问题