您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php怎么实现月份数字转英文

2024/6/4 7:05:51发布27次查看
php实现月份数字转英文的方法:首先创建一个php示例文件;然后通过“public function month_e($num){...}”方法将数字转换为英文月份即可。
本文操作环境: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怎么实现月份数字转英文的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product