strtotime result makes no sense, php bug?

后端 未结 3 1702
醉梦人生
醉梦人生 2021-02-18 14:38

The following line:

echo date(\'d\', strtotime(\'First Saturday August 2015\'));

prints 08, which doesn\'t seem to make any sense

3条回答
  •  野的像风
    2021-02-18 15:19

    As stated, PHP didn't quite understand your choice of dialect. If you plan on accepting varied input from your users (not a bad idea) to express a date, I suggest doing some normalization of that user input yourself so that you can submit a predictable format to strtotime.

提交回复
热议问题