{"id":579,"date":"2011-01-01T15:37:06","date_gmt":"2011-01-01T14:37:06","guid":{"rendered":"http:\/\/blog.unelink.es\/?p=579"},"modified":"2018-08-06T09:44:31","modified_gmt":"2018-08-06T07:44:31","slug":"calcular-el-numero-de-dias-de-un-mes-en-concreto","status":"publish","type":"post","link":"https:\/\/hosting.airetech.es\/blog\/wiki\/calcular-el-numero-de-dias-de-un-mes-en-concreto\/","title":{"rendered":"Calcular el n\u00famero de d\u00edas de un mes en concreto"},"content":{"rendered":"<p>Para calcula el <strong>n\u00famero de d\u00edas <\/strong>de un mes en concreto a trav\u00e9s de php podemos utilizar la funci\u00f3n que viene en PHP llamada <a title=\"cal_days_in_month\" href=\"https:\/\/secure.php.net\/manual\/es\/function.cal-days-in-month.php\" target=\"_blank\"><strong>cal_days_in_month<\/strong><\/a>.<\/p>\n<p>Esta funci\u00f3n necesita tres parametros: el calendario que se va a utilizar para el c\u00e1lculo, el mes y el a\u00f1o. Quedar\u00eda as\u00ed:<\/p>\n<pre>int <strong>cal_days_in_month<\/strong> ( int <tt>$calendar<\/tt> , int <tt>$month<\/tt> , int <tt>$year<\/tt> )<\/pre>\n<p>Un ejemplo para explicar mejor la funci\u00f3n:<\/p>\n<pre>&lt;?php\r\n$n\u00famero\u00a0=\u00a0cal_days_in_month(CAL_GREGORIAN,\u00a08,\u00a02003);\r\necho\u00a0\"Hubo\u00a0$n\u00famero\u00a0d\u00edas\u00a0en\u00a0agosto\u00a0del\u00a02003\";\r\n?&gt;<\/pre>\n<p>En este caso el resultado ser\u00edan <strong>31 d\u00edas<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"Para calcula el n\u00famero de d\u00edas de un mes en concreto a trav\u00e9s de php podemos utilizar la funci\u00f3n que viene en PHP llamada cal_days_in_month. Esta funci\u00f3n necesita tres parametros: el calendario que se va a utilizar para el c\u00e1lculo, el mes y el a\u00f1o. Quedar\u00eda as\u00ed: int cal_days_in_month ( int $calendar , int $month , int $year ) Un&nbsp;<a href=\"https:\/\/hosting.airetech.es\/blog\/wiki\/calcular-el-numero-de-dias-de-un-mes-en-concreto\/\" class=\"read-more\">Seguir leyendo<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[39,6],"tags":[41,42,40],"class_list":["post-579","post","type-post","status-publish","format-standard","hentry","category-php","category-wiki","tag-fechas-en-php","tag-numero-dias-de-un-mes","tag-timestamp-php","cat-39-id","cat-6-id"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/comments?post=579"}],"version-history":[{"count":10,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/579\/revisions"}],"predecessor-version":[{"id":7166,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/579\/revisions\/7166"}],"wp:attachment":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media?parent=579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/categories?post=579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/tags?post=579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}