Posted By

Tate on 01/13/09


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

basicmagic
bryandease
Priestd09


Pluralize Function to change wording based on the number of results (0,1,or more)


 / Published in: PHP
 

  1. function Pluralize($number, $plural, $singular) {
  2. if ($number == 1) {
  3. return $singular;
  4. } else {
  5. return $plural;
  6. }
  7. }

Report this snippet  

You need to login to post a comment.