0
例如我的月号是(3
= 3月)或(2
= 2月),我试了下面的代码,但它不起作用。如何解决它?如何将月份数字转换为月份短名称?
$month = 2;
echo date('M', strtotime($month));
演示:http://codepad.viper-7.com/ZKctjg
例如我的月号是(3
= 3月)或(2
= 2月),我试了下面的代码,但它不起作用。如何解决它?如何将月份数字转换为月份短名称?
$month = 2;
echo date('M', strtotime($month));
演示:http://codepad.viper-7.com/ZKctjg
基于您的代码:
$month = 2;
echo date('M', strtotime('2012-' . $month . '-01'));
strtotime()
接受日期不只是一个月
这已经问:) HTTP: //stackoverflow.com/quest离子/ 2943292 /转换月份与月份之间的短名称 和这里 http://stackoverflow.com/questions/4612012/php-convert-month-number-to-short-month-name – user690936 2012-01-01 07:26:26
这已经问 http://stackoverflow.com/questions/2943292/convert-month-number-to-month-short-name – user690936 2012-01-01 07:26:48
这已经问 的http://计算器.com/questions/2943292/convert-month-number-to-month-short-name http://stackoverflow.com/questions/4612012/php-conv月份 - 月 - 月 - 短名称 – user690936 2012-01-01 07:27:54