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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

java - Log4j2 configuration not found when running standalone application builded by shade plugin -

python - How do I create a list index that loops through integers in another list -