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

前端 未结 15 1446
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:45

    fastest should probably be

    false!== ($date !== $date=preg_replace(';[0-2]{2}/[0-2]{2}/[0-2]{2};','$3-$2-$1',$date))
    

    this will return false if the format does not look like the proper one, but it wont-check wether the date is valid

提交回复
热议问题