I'm having difficulty generating a number in each input id. I need to display 4 images, and I saved their names in the database separating them with a comma, then gave them an explode to display them in foreach.
$array = explode(',', $sqlImagem['enderecoImagem']);
foreach($array as $valores)
{
echo '<a href="#" id="'.$id.'"><img src="Admin/Pagina/Produtos/uploads/'.$valores.'"/></a>';
}
But the problem is that I need to style a gallery with a thumbnail, and for that I need to generate a number (I tried to make an array but I did not succeed) input id as an example above.
Example of code when with just html, that would be how I need it ...
<a href="#" id="1"> <img src="Imagens/teste/k7 sunrace 1.jpg"/> </a>
<a href="#" id="2"> <img src="Imagens/teste/k7 sunrace.jpg"/> </a>
<a href="#" id="3"> <img src="Imagens/teste/k7.jpg"/> </a>
<a href="#" id="4"> <img src="Imagens/teste/k7 sunrace 2.jpg"/> </a>