[英]How is convert month number to month short name?
例如,我的月數是( 3
= 3月)或( 2
= 2月),我嘗試按以下代碼進行操作,但它不起作用。 如何解決?
$month = 2;
echo date('M', strtotime($month));
根據您的代碼:
$month = 2;
echo date('M', strtotime('2012-' . $month . '-01'));
strtotime()
接受日期而不僅僅是月份
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.