$thenumber = 0;

$thenumber++;

i've tried putting this inside the brackets for the for loop and it isn't working. the number stays as 1.

theres alot of code so i can't post the whole for loop.

Recommended Answers

All 3 Replies

What do u need??explain your question and people will help you.

$thenumber = 0;

$thenumber++;

i've tried putting this inside the brackets for the for loop and it isn't working. the number stays as 1.

theres alot of code so i can't post the whole for loop.

I dunno, maybe the ++ stuff only works in the context of a loop syntax.

If you want to count, try:

$thenumber= $thenumber+1;

If every time you go through the loop, you set $number = 0 and increment it to one, it's not gonna work.

$i = 0;
for ($i<$whateveryourvaris) {
echo "Number {$i}...<br />";
$i++;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.