<?php for ($i=1; $i<=12; $i++) { $funcao = new DateTime("2018-".$i); $numDias = $funcao->format('t'); echo $numDias."\n"; }
Standard input is empty
31 28 31 30 31 30 31 31 30 31 30 31
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!