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
Post a Comment