Functions in PHP
Jump to navigation
Jump to search
Here's the format of a function:
function plus() { ?><img src="./images/plus.gif" width=22 height=22 alt="+" border="0" align="top"> <? }
Here's how to call a function:
plus();
![]() Learn more... |
ordinal numbers function
In English, when referring to the day of the month, cardinal numbers (1, 2, 3, etc.) are converted to ordinal numbers by adding a suffix to indicate their position in the sequence. The suffixes used are -st, -nd, -rd, and -th
PHP has a Added getOrdinalSuffix function to convert rentdueday (e.g., 1, 2, 3) to ordinal form (1st, 2nd, 3rd, 4th, etc.).
Example:
<?php echo htmlspecialchars(getOrdinalSuffix($tablename['day'])); ?>