0
Help us understand the problem. What are the problem?

posted at

【PHP】【月の日数問題】西暦の年月を入力して、その月の日数を求めよ

コード

<?php

$datetime = DateTimeImmutable::createFromFormat('Y年m月', '2020年02月');

echo $datetime->format('t'); 

結果

29

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
0
Help us understand the problem. What are the problem?