Functions in PHP

From Free Knowledge Base- The DUCK Project
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();

 

Note: This page is notably incomplete. You can help. Please contribute by registering your email address and adding your knowledge to this page. The D.U.C.K. wiki was created to be a free informative place that allows an open exchange of accurate information.
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'])); ?>