How can I print (echo) the days of an unknown month if the month and year are parameters?
Thank.
To get the number of days in a given month of a given year, you can use cal_days_in_month
cal_days_in_month
echo cal_days_in_month(CAL_GREGORIAN, 10, 2010); // prints 31
You can also use the date () function to get the number of days per month. You can also pass the 2nd parameter to strtotime () and specify a specific date:
$daysInMon = date('t', mktime(0, 0, 0, $month));
Source: https://habr.com/ru/post/1768463/More articles:Disabling the submit button stops the PHP / Javascript submit form - jqueryhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1768459/drupal-views-of-nodes-to-show-node-comments&usg=ALkJrhi_zxgWKa-iq9ylYo61AlgCDKSM7gTesting a View in an MVFM WPF Application - wpfClassify or cut a data frame from a list of class ranges and summarize it with ddply - rExtract primary key from entity object in JPA 2.0? - javaLatex \ newcommand for \ end {verbatim} et.al not working - latexHow to copy CUDA generated PBO to texture with Mipmapping - cudasetting Sqlite3-ruby error - sqlite3-rubyWCF authentication does not impersonate administrator - c #Is there a legitimate reason to use a large number of varchar fields? (MS SQL DB) - typesAll Articles