Php将日期转换为字符串

Php将日期转换为字符串,php,Php,我已经搜索过了,但找不到如何从字符串转换日期。例如字符串日期为2016年8月18日我想转换为2016年8月18日我该怎么办 $input = '18-08-2016'; echo strftime('%d %B %Y',strtotime($input));// 18 August 2016 将输出格式化为您喜欢的格式。您是否已签出此帖子?我没看见对不起,谢谢

我已经搜索过了,但找不到如何从字符串转换日期。例如字符串日期为2016年8月18日我想转换为2016年8月18日我该怎么办

$input = '18-08-2016';
echo strftime('%d %B %Y',strtotime($input));// 18 August 2016

将输出格式化为您喜欢的格式。

您是否已签出此帖子?我没看见对不起,谢谢