5
The question is as follows, whether I have a foreach or which; want another repeat structure that receives data from the table and displays the categories:
foreach ($categories as $c){
$c.nome . ' - ';
}
assuming that this code would display as a result:
Categoria_1 - Categoria_2 - Categoria_3 -
How to make this "-" not appear after the last loop repeat, how to hide it?
My intention is that instead of displaying as shown above the final result is:
Categoria_1 - Categoria_2 - Categoria_3
with the "-" appearing neither at the beginning nor at the end, but only among the names of the categories.
$c.nome
would be$c->nome
? The$c
is an object?– bfavaretto