{"id":264,"date":"2010-07-23T00:30:16","date_gmt":"2010-07-23T04:30:16","guid":{"rendered":"http:\/\/www.searchenginegenie.com\/programming-blog\/?p=264"},"modified":"2012-12-11T04:43:57","modified_gmt":"2012-12-11T08:43:57","slug":"to-display-current-dateno-of-days-and-weeks-in-a-month-and-year","status":"publish","type":"post","link":"https:\/\/www.searchenginegenie.com\/programming-blog\/to-display-current-dateno-of-days-and-weeks-in-a-month-and-year\/","title":{"rendered":"To display current date,no.of days and weeks in a month and year using php"},"content":{"rendered":"<p><strong>1:Create new php file and copy the code and save it as file1.php.<\/strong><\/p>\n<p><strong>2.Run file1.php, then it will display the current date and no.of days,weeks in a month and year.<\/strong><\/p>\n<p>[php]<br \/>\n&lt;?php<br \/>\n echo\u00a0 &quot;My name is: John&quot;.&quot;&lt;br\/&gt;&quot;;<br \/>\n echo &quot;current date is:&quot;.&quot;\\n&quot; .date(&quot;Y m d h: s: m&quot;) .&quot;&lt;br\/&gt;&quot;;<br \/>\n echo &quot;No of days in a month:&quot;.&quot;\\n&quot; .cal_days_in_month( CAL_GREGORIAN, 07, 2010) .&quot;&lt;br\/&gt;&quot;;<br \/>\n echo &quot;No of weeks in a month:&quot;.&quot;\\n&quot;.date(&quot;w&quot;, mktime(0,0,0,12,31,2010)) .&quot;&lt;br\/&gt;&quot;;<br \/>\n echo &quot;No of weeks in a year:&quot;.&quot;\\n&quot; .date(&quot;W&quot;, mktime(0,0,0,12,31,2010)) .&quot;&lt;br\/&gt;&quot;;<br \/>\n ?&gt;<br \/>\n[\/php]<\/p>\n<p><strong>It display the output as:<\/strong><\/p>\n<p><strong>My name is: John<br \/>\ncurrent date is: 2010 07 23 04: 46: 07<br \/>\nNo of days in a month: 31<br \/>\nNo of weeks in a month: 5<br \/>\nNo of weeks in a year: 52<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1:Create new php file and copy the code and save it as file1.php. 2.Run file1.php, then it will display the current date and no.of days,weeks in a month and year. [php] &lt;?php echo\u00a0 &quot;My name is: John&quot;.&quot;&lt;br\/&gt;&quot;; echo &quot;current date is:&quot;.&quot;\\n&quot; .date(&quot;Y m d h: s: m&quot;) .&quot;&lt;br\/&gt;&quot;; echo &quot;No of days in a month:&quot;.&quot;\\n&quot; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1],"tags":[15],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-php","category-programming","tag-php-code"],"_links":{"self":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":7,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":604,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts\/264\/revisions\/604"}],"wp:attachment":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}