本文操作环境:windows7系统、php7.1版,dell g3电脑
把当前数字月份转换为英文月份
该函数实现将数字转换为英文月份
<?phpclass num_chinese{ private $month_e = array(1 => "january", 2 => "february", 3 => "march", 4 => "april", 5 => "may", 6 => "june", 7 => "july", 8 => "august", 9 => "september", 10 => "october", 11 => "november", 12 => "december"); public function month_e($num){ return $this -> month_e[$num]; }}?>
使用方法
<?phprequire_once("./上面类函数的页面名称");$da = new num_chinese();echo $da -> month_e(1);?>
推荐学习:《php视频教程》
以上就是php怎么实现月份数字转英文的详细内容。
