2
How can I change this code further down?
It takes the numeric values placed in Mysql in the medial table separated by comma placed in this way in the table 1,2,3,4,5,6,7,8,9,10
. Then it counts the total of items placed in this table separated by a comma. If it has more than one comma-separated value the message appears in the plural otherwise it appears in the singular. But I’m having a problem: let’s say that the value inserted in Mysql is like this in the table medias
: 1,
. It places the message in the plural, not the singular. To remain singular, it is necessary that the inserted value is without the comma on the side, this way: 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><? } ?>
If an answer solved your problem you can accept it. See the [tour].
– Maniero
I’m just commenting to reinforce the @bigown comment. Your doubt today (well no, today, today) may be that of another person tomorrow and having an answer marked as resolved helps the process of assimilation of that someone. ;)
– Bruno Augusto