当前位置:网站首页>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] ?? "";
}
边栏推荐
- Solve the problem of bindchange event jitter of swiper component of wechat applet
- SQL injection closure judgment
- 解决微信小程序swiper组件bindchange事件抖动问题
- Brief analysis of PHP session principle
- QQ email cannot receive the email sent by Jenkins using email extension after construction (timestamp or auth...)
- Usage of map and foreach in JS
- There are multiple good constructors and room will problem
- Solution to the black screen of win computer screenshot
- SQLI-LABS通关(less18-less20)
- Kali latest update Guide
猜你喜欢

How to debug wechat built-in browser applications (enterprise number, official account, subscription number)

Wechat applet Foundation

默认google浏览器打不开链接(点击超链接没有反应)

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

No process runs when querying GPU, but the video memory is occupied

Explanation and application of annotation and reflection

蚂蚁集团g6初探

The table component specifies the concatenation parallel method

Usage of map and foreach in JS

Uploading attachments using Win32 in Web Automation
随机推荐
Redis -- cache breakdown, penetration, avalanche
sqli-labs通关汇总-page2
sqli-labs通关汇总-page4
Sqli-labs customs clearance (less18-less20)
Fe - eggjs combined with typeorm cannot connect to the database
js中map和forEach的用法
Solve the problem of bindchange event jitter of swiper component of wechat applet
Wechat applet Foundation
由于不正常断电导致的unexpected inconsistency;RUN fsck MANUALLY问题已解决
SQLI-LABS通關(less6-less14)
Uniapp introduces local fonts
Eggjs -typeorm treeenity practice
PXC high availability cluster summary
In depth study of JVM bottom layer (IV): class file structure
Selenium+msedgedriver+edge browser installation driver pit
Loops in tensorrt
The win10 network icon disappears, and the network icon turns gray. Open the network and set the flash back to solve the problem
Sqli - Labs Clearance (less6 - less14)
JS create a custom JSON array
[leetcode question brushing day 35] 1060 Missing element in ordered array, 1901 Find the peak element, 1380 Lucky number in matrix