当前位置:网站首页>PHP returns the abbreviation of the month according to the numerical month
PHP returns the abbreviation of the month according to the numerical month
2022-07-02 07:28:00 【Snow wind in the night sky】
Preface
In the process of project development, sometimes it is necessary to convert the month into English .
/** * Get month abbreviation * @param string $month month */
function get_month_abbr($month)
{
$month = (int) $month;
$monthEng = [
1 => "Jan",
2 => "Feb",
3 => "Mar",
4 => "Apr",
5 => "May",
6 => "Jun",
7 => "Jul",
8 => "Aug",
9 => "Sep",
10 => "Oct",
11 => "Nov",
12 => "Dec",
];
return $monthEng[$month] ?? "";
}
边栏推荐
- SSM personnel management system
- A summary of a middle-aged programmer's study of modern Chinese history
- 【信息检索导论】第三章 容错式检索
- 使用 Compose 实现可见 ScrollBar
- view的绘制机制(一)
- 点云数据理解(PointNet实现第3步)
- 叮咚,Redis OM对象映射框架来了
- 华为机试题-20190417
- ssm+mysql实现进销存系统
- Oracle segment advisor, how to deal with row link row migration, reduce high water level
猜你喜欢
随机推荐
Oracle EBS ADI development steps
Jordan decomposition example of matrix
自然辩证辨析题整理
PointNet原理证明与理解
优化方法:常用数学符号的含义
解决万恶的open failed: ENOENT (No such file or directory)/(Operation not permitted)
DNS attack details
【BERT,GPT+KG调研】Pretrain model融合knowledge的论文集锦
Message queue fnd in Oracle EBS_ msg_ pub、fnd_ Application of message in pl/sql
Oracle segment advisor, how to deal with row link row migration, reduce high water level
Oracle EBS interface development - quick generation of JSON format data
使用Matlab实现:Jacobi、Gauss-Seidel迭代
华为机试题-20190417
oracle-外币记账时总账余额表gl_balance变化(上)
view的绘制机制(三)
The boss said: whoever wants to use double to define the amount of goods, just pack up and go
华为机试题
Practice and thinking of offline data warehouse and Bi development
如何高效开发一款微信小程序
SSM学生成绩信息管理系统