I have a sentence like this:
<h5>There are <?php echo $total_results_count; ?> results waiting for you!</h5>
How could I modify this to say:
There is 1 result waiting for you!
if there is only 1 result.
I have a sentence like this:
<h5>There are <?php echo $total_results_count; ?> results waiting for you!</h5>
How could I modify this to say:
There is 1 result waiting for you!
if there is only 1 result.
<h5><?php
if ($total_results_count > 1) {
echo 'There are ' . $total_results_count . ' results';
}
else {
echo 'There is ' . $total_results_count . ' result';
} ?> waiting for you!</h5>