Skip to Content


A convenient PHP function for returning a singular or plural label string based on the value.

PHP February 26, 2023


singular_plural($value, $singular, $plural)


(Required) (Integer or Float) The value to determine the label for
Default: None

(Required) (String) The singular label
Default: None

(Optional) (String) The plural label
Default: Adds an "s" to the singular label

Parameter Notes

If the plural form of the singular label is the same but with an “s” (like “book” and “books”), you do not need to pass the plural parameter.

Request or provide clarification »


When the plural simply adds an "s", no need for the third parameter.

echo singular_plural($number, 'hour');

When the plural is spelled differently, the third parameter is needed.

echo singular_plural($number, 'story', 'stories');
Was this page helpful? Yes No

    A feedback message is required to submit this form.

    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    This function was not found in /libs/Utilities.php. Please report this error.

    No Hooks

    This function does not have any filters or actions available. Request one?


    This function can not be short-circuited with an override filter. Request one?