2
well then I would like to know if there is some form in PHP to do the following, define a variable ex: $contactorinicio = "0"; and then whenever you call her in php she goes adding another EX: $counter = $counter + "'"; however each time I use an echo exit the result summed in sequence EX:
<?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 so
<a href="#menu1" >produtos</a>
<a href="#menu2" >foto</a>
con javascript ate consegui mais seria possivel isso no php puro?
The @rray user gave me the hint and it worked like this
<?php $contador = "0"; ?>
<?php echo ++$contador; ?> // imprime 1
<?php echo ++$contador; ?> // imprime 2
<?php echo ++$contador; ?> // imprime 3
Anderson did not understand, from what I read apparently you showed what you wanted to do.
– Julio Henrique
Calling it in PHP in what way?
– user60252
Can do
++$contadornovo;
– rray
like the model below, every time I call her $countered it keep adding +1 EX: 1st time $countered = 1 $countered = 2 $countered = 3 understood?
– Arsom Nolasco
@rray the result was the same stayed 1 1
– Arsom Nolasco
@Juliohenrique97 updated the post with example
– Arsom Nolasco
Tried to thus ?
– rray
did it work out if it had gotten the wrong name <? php $counter = "0"; ? > <? php echo ++$counter; ? > <? php echo ++$counter; ? > <? php echo ++$counter; ?>
– Arsom Nolasco