So I would like to know if there is any way in PHP to do the following, set an ex variable: $ contatorinicio="0"; and then whenever you call it in php it will add up another EX: $ counternew = $ counter + "'"; however each time I use an echo output the sum sum in EX sequence:
<?php $contador = "0";
$contadornovo = $contador++;
<a href="#menu<? echo $contadornovo"; ?>" >produtos</a>
<a href="#menu<? echo $contadornovo"; ?>" >fotos</a>
In case it would be printed like this
<a href="#menu1" >produtos</a>
<a href="#menu2" >foto</a>
With javascript until I got more would it be possible in pure php?
The @rray user gave me the hint and it worked as follows
<?php $contador = "0"; ?>
<?php echo ++$contador; ?> // imprime 1
<?php echo ++$contador; ?> // imprime 2
<?php echo ++$contador; ?> // imprime 3