Strtotime() doesn't work with dd/mm/YYYY format

前端 未结 15 1091
Happy的楠姐
Happy的楠姐 2020-11-22 09:33

I really like the strtotime() function, but the user manual doesn\'t give a complete description of the supported date formats. strtotime(\'dd/mm/YYYY\')<

15条回答
  •  无人及你
    2020-11-22 09:50

    The simplest solution is this:

    $date    = '07/28/2010';
    $newdate = date('Y-m-d', strtotime($date));
    

提交回复
热议问题