i'm trying to make a number increase inside a function, but i got a problem, the number won't go higher then 1 and i can't figure this out... this is the code i've got so far:
edit i figured out a solution...PHP Code:function increase($test)
{
global $nr;// global variable
$nr++;
echo $test . "<br />";
echo $nr . "<br />";
}
increase("test1");
increase("test2");
i just needed to add global $nr; to the code.




Reply With Quote