Show "word" singular if there is only one entry in PHP? -


i have span this:

<p> <span>{{ queue_count }} </span> </p> 

queue_count may contain 0 or 1 entry , greater. if queue_count less or equals 1 want show {{ queue_count }} entry otherwise {{ queue_count }} entries, how can that?

its simple. use if else condition.

if(queue_count <= 1) {    <p> <span>{{ queue_count }} entry </span> </p> } else {     <p> <span>{{ queue_count }} entries </span> </p> } 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -