379716 visitors has seen the Tim-Carter.com site. Thanks!
321 visitors has seen the Tim-Carter.com site today.
 
 
Search :  
 
>>> Programming >> PHP > How to use English Ordinal Suffix for the day of a month with PHP and MKTIME (This page has been seen 1356 times)

How to use English Ordinal Suffix for the day of a month with PHP and MKTIME

This is an example on how to use the suffix for a date, like 1st, 2nd, 3rd or 5th day


The Code:
$Month = date("m");
$Year = date("y");
$Day = date("d");
$TheDay = date("j", mktime(0, 0, 0, $Month, $Day, $Year)).date("S", mktime(0, 0, 0, $Month, $Day, $Year));
$TheMonth = date("F", mktime(0, 0, 0, $Month, $Day, $Year));
$TheYear = date("Y", mktime(0, 0, 0, $Month, $Day, $Year));

echo "This is the $TheDay day of $TheMonth, $TheYear ";

Like (3)
 
Dislike (0)


Keywords for this article:
MKTIME || DATE || ENGLISH ORDINAL SUFFIX || DAY || 1st || 2nd || 3rd || 5th

Post comment

Name:


Comment:

Code Language:

Code:

Here you can paste a code example. It will then be processed by SyntaxHighlighter and formatted for easier readability.
Please remember to select the correct Code Language in the select above so the SyntaxHighlighter can highlight the code properly.




Code:

Please enter the code you see above

What is 8 + 3 =

Submit Comment


No one has commented on this page yet. You could be the first.


Advertisement by Google


Sponsors :