For example,
In the middle of my code I do
echo $num; //me retorna 1, mas se eu ecoar novamente a variável "$num"
//me retornará 2 e assim sucessivamente.
I have tried in many ways, but I have not been able to:
function add_um(){
}
add_um(); //Nesse caso toda vez que eu chamasse a função ela
//me traria um número diferente do anterior, sempre acrescentando 1 unidade.
I tried with while
, but fell into an infinite loop 1234567 ...
ADDED:
Can I use $num
to name a session? type, $_SESSÃO[$num];
and then name another session hypothetically like this: $_SESSÃO[$num++];
?
That's what I needed. Naming sessions automatically.
I thought of using for
to create a $i
that would increment ( i++
) to each loop to name the sessions, but I'm already working inside a for
and then the loops would keep repeating .