Home > Article > Backend Development > How to convert month numbers to English in PHP
php method to convert month numbers to English: First create a PHP sample file; then use the "public function Month_E($Num){...}" method to convert the numbers into English months.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
Convert the current digital month to English month
This function converts numbers into English months
<?php class 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]; } } ?>
Usage method
<?php require_once("./上面类函数的页面名称"); $da = new Num_Chinese(); echo $da -> Month_E(1); ?>
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to convert month numbers to English in PHP. For more information, please follow other related articles on the PHP Chinese website!