RE: [PHP] ++$i and $i++ whatz the difference?

From: Date: Wed, 28 Feb 2001 07:59:02 +0000
Subject: RE: [PHP] ++$i and $i++ whatz the difference?
Groups: php.general 
Request: Send a blank email to php-general+get-41960@lists.php.net to get a copy of this message
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:dhaval_adams@yahoo.com] Sent: Wednesday, February 28, 2001 12:50 AM To: php-general@lists.php.net 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: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net

« previous php.general (#41960) next »