Sometimes you have a dynamic sentence with a amount in it. How to show the plural or not?

See the simple example:

//$users is an array is this example
$echoUsers = (count($users) == 1) ? $users.' user registered' : $users.' users registered';

echo $echoUsers;

Most Commented Posts

Leave a Comment

Get your own Gravatar!
Your email will never be published!

Notify me of followup comments via e-mail

Top of Page