My function is supposed to take a variable that already exists on the page, spit it out, then increment it. This should happen every time the function is called from within my code. The incremented value should be persistent - every function call should make it larger.
$modcounter = 1;
function nextname() {
global $modcounter;
return $modcounter;
$modcounter++;
}
echo nextname() keeps returning the same value no matter how many times i've called it.
what am i doing wrong here?
Thanks!