The question is whether I have a foreach or any other repeat structure that receives data from the table and displays the categories:
foreach ($categories as $c){
$c.nome . ' - ';
}
Assuming this code would display as a result:
Categoria_1 - Categoria_2 - Categoria_3 -
How do you make sure that this "-" does not appear after the last loop, how do you hide it?
My intention is that instead of displaying as shown above the end result is:
Categoria_1 - Categoria_2 - Categoria_3
with "-" appearing neither at the beginning nor at the end, but only in the category names.