当前位置:网站首页>Learn the method code example of converting timestamp to uppercase date using PHP
Learn the method code example of converting timestamp to uppercase date using PHP
2022-07-02 15:07:00 【Lingering memory of Yu Fei】
Learn to use php Method code example of converting timestamp to uppercase date
design sketch
Current date in lowercase -----2022-06-27 17:45:25
The current date is capitalized ----- Two 〇 June 27, 2002
The current date is capitalized ----- June 27, 2002

Encapsulation method
function dateTimeToUpper($stamp, $type)
{
$year = str_split(date('Y', $stamp));
$month = intval(date('m', $stamp));
$day = intval(date('d', $stamp));
$chars = array(
0 => ['〇', ' zero '],
1 => [' One ', ' one '],
2 => [' Two ', ' Ii. '],
3 => [' 3、 ... and ', ' 3 '],
4 => [' Four ', ' boss '],
5 => [' 5、 ... and ', ' wu '],
6 => [' 6、 ... and ', ' lu '],
7 => [' 7、 ... and ', ' Retailer, '],
8 => [' 8、 ... and ', ' '],
9 => [' Nine ', ' nine '],
10 => [' Ten ', ' Ten '],
11 => [' 11、 ... and ', ' Ten '],
12 => [' Twelve ', ' twelve '],
13 => [' 13、 ... and ', ' Thirteen '],
14 => [' fourteen ', ' Forty four '],
15 => [' 15、 ... and ', ' fifteen '],
16 => [' sixteen ', ' sixteen '],
17 => [' seventeen ', ' seventeen '],
18 => [' eighteen ', ' eighteen '],
19 => [' nineteen ', ' nineteen '],
20 => [' twenty ', ' twenty '],
21 => [' The 21st ', ' Twenty one '],
22 => [' Twenty-two ', ' twenty-two '],
23 => [' 23 ', ' twenty-three '],
24 => [' Twenty-four ', ' Twenty four '],
25 => [' twenty-five ', ' Twenty five '],
26 => [' hexacosa- ', ' Twenty six '],
27 => [' twenty-seven ', ' Twenty seven '],
28 => [' Twenty-eight ', ' Twenty eight '],
29 => [' Twenty-nine ', ' Twenty nine '],
30 => [' thirty ', ' thirty '],
31 => [' Thirty-one ', ' Thirty one '],
);
$date = '';
foreach ($year as $y) {
$date .= $chars[$y][$type];
}
$date .= ' year ';
$date .= $chars[$month][$type] . ' month ';
$date .= $chars[$day][$type] . ' Japan ';
return $date;
}
echo ' Current date in lowercase ==' . $now_time = date('Y-m-d H:i:s', time());
echo '<br>';
echo ' The current date is capitalized = The first style =' . dateTimeToUpper(time(), 0);
echo '<br>';
echo ' The current date is capitalized = The second style =' . dateTimeToUpper(time(), 1);
echo '<br>';

边栏推荐
- Actual combat sharing of shutter screen acquisition
- Advanced C language (realize simple address book)
- C language exercises - (array)
- C code audit practice + pre knowledge
- GeoServer offline map service construction and layer Publishing
- 原则、语言、编译、解释
- Xilinx Vivado set *.svh as SystemVerilog Header
- .NET Core 日志系统
- 电脑怎么设置扬声器播放麦克风的声音
- 用户隐私协议有些汉字编码不规范导致网页显示乱码,需要统一找出来处理一下
猜你喜欢

Have you learned the wrong usage of foreach

Edit the formula with MathType, and set it to include only mathjax syntax when copying and pasting
![[development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)](/img/7b/2c471c070a3faa981f70136603495a.jpg)
[development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)

Jenkins Pipeline 应用与实践

Factal: Unsafe repository is owned by someone else Solution

Actual combat sharing of shutter screen acquisition

CTO如何帮助业务?

vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)

It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen

【apipost】使用教程
随机推荐
vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
【apipost】使用教程
用户隐私协议有些汉字编码不规范导致网页显示乱码,需要统一找出来处理一下
Sharp tool SPL for post SQL calculation
IE 浏览器正式退休
【题解】Educational Codeforces Round 82
[c voice] explain the advanced pointer and points for attention (2)
2021-2022學年編譯原理考試重點[華僑大學]
如何用 Sysbench 测试 TiDB
Record an error report, solve the experience, rely on repetition
SQL 后计算的利器 SPL
Jenkins Pipeline 应用与实践
Makefile separates file names and suffixes
MFC 定时器使用
MFC A对话框调用B对话框函数并传参
电脑怎么设置扬声器播放麦克风的声音
LeetCode 209. 长度最小的子数组
C#代码审计实战+前置知识
Introduction to C language -- array
taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface