当前位置:网站首页>php中根据数字月份返回月份的英文缩写
php中根据数字月份返回月份的英文缩写
2022-07-02 06:23:00 【夜空の雪風】
前言
在项目开发的过程中有时候需要对月份进行英文转换。
/** * 获取月份缩写 * @param string $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] ?? "";
}
边栏推荐
- Eslint configuration code auto format
- Apt command reports certificate error certificate verification failed: the certificate is not trusted
- VSCODE 安装LATEX环境,参数配置,常见问题解决
- Flex Jiugongge layout
- Sentry搭建和使用
- PHP Session原理简析
- js删除字符串的最后一个字符
- js中map和forEach的用法
- The table component specifies the concatenation parallel method
- Latex参考文献引用失败 报错 LaTeX Warning: Citation “*****” on page y undefined on input line *
猜你喜欢

There is no way to drag the win10 desktop icon (you can select it, open it, delete it, create it, etc., but you can't drag it)

Recursion (maze problem, Queen 8 problem)

SQLI-LABS通关(less2-less5)

js中map和forEach的用法

Latest CUDA environment configuration (win10 + CUDA 11.6 + vs2019)

Build learning tensorflow

Win10: add or delete boot items, and add user-defined boot files to boot items

Latex在VSCODE中编译中文,使用中文路径问题解决

Sqli-labs customs clearance (less6-less14)

Sublime text configuring PHP compilation environment
随机推荐
Stress test modification solution
[literature reading and thought notes 13] unprocessing images for learned raw denoising
PXC high availability cluster summary
20201025 visual studio2019 qt5.14 use of signal and slot functions
2020-9-23 use of QT timer qtimer class.
flex九宫格布局
Sqli - Labs Clearance (less6 - less14)
js的防抖和节流
Underlying mechanism mvcc
CAD二次开发 对象
Brief analysis of PHP session principle
Atcoder beginer contest 253 F - operations on a matrix / / tree array
Nodejs - Express middleware modification header: typeerror [err_invalid_char]: invalid character in header content
Latex 编译报错 I found no \bibstyle & \bibdata & \citation command
Kali latest update Guide
2021-07-17C#/CAD二次开发创建圆(5)
Implement strstr() II
[self cultivation of programmers] - Reflection on job hunting Part II
2021-07-19C#CAD二次开发创建多线段
Cve-2015-1635 (ms15-034) Remote Code Execution Vulnerability recurrence