>From what I've read in the manual one is a post increment and the other is a
pre increment.
YOu may not see the difference in a loop statement... but if you use
simple variables like the php manual does, you'll get different results.
ref:
http://www.php.net/manual/en/language.operators.increment.php
Jay Klehr
ConsoleCity
www.consolecity.com
-----Original Message-----
From: Dhaval Desai [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 28, 2001 12:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] ++$i and $i++ whatz the difference?
Hi!
I have a simple question. Please see the code below:
<?php
for($i=0; $i<=10; $i++)
{
echo "$i<br>";
}
?>
Now, See this code:
<?php
for($i=0; $i<=10; ++$i)
{
echo "$i<br>";
}
?>
I get the same out put from both the Scrits. What's
the difference then anywayz?
Thank You!
Dhaval Desai
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]