How can I change this code below?
It takes the numeric values placed in MySQL in the comma separated table by placing them in the 1,2,3,4,5,6,7,8,9,10
table. Then it counts the total of items placed in this table separated by the comma. If it has more than one value separated by a comma the message appears in the plural otherwise it appears in the singular. But I'm having a problem: let's say the value entered in MySQL is like this in the medias
: 1,
table. It puts the message in the plural rather than the singular. To be in the singular it is necessary that the inserted value be without the comma on the side, like this: 1
.
How can I fix this?
<?php $contagem = explode(',', $episodios);
$count = count($contagem); ?>
<? if ($count == 1) { ?><div class="separadores"><div class="separador3">Ultimo Episodio Postado</div></div><? }else { ?><div class="separadores"><div class="separador3">Ultimos Episodios Postados</div></div><? } ?>