RE: [PHP] Increment
| From: | Peter Benoit | Date: | Thu, 29 Jun 2000 21:44:00 +0000 |
| Subject: | RE: [PHP] Increment | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-3903@lists.php.net to get a copy of this message | ||
Well it really didn't matter, because I know it loops through more than
once. Problem is that $i always equals 1.
I have something like
$i = 1;
if(blue == "yes"){
$i++;
}
echo ("$i");
Now if blue was yes 13 times, $i still equals 1.
Confused,
Peter
-----Original Message-----
From: Broussard, Chris (CAP, VFS) [mailto:Chris.Broussard@gecapital.com]
Sent: Thursday, June 29, 2000 5:49 PM
To: 'Peter Benoit'
Subject: RE: [PHP] Increment
if you want to do a if/then.. i don't know what your $whatever condition is
though?
if($whatever)
{
$i++;
}
echo ("$i");
-----Original Message-----
From: Peter Benoit [mailto:pbenoit@triton-network.com]
Sent: Thursday, June 29, 2000 4:40 PM
To: 'Broussard, Chris (CAP, VFS)'
Subject: RE: [PHP] Increment
It still doesn't work however, does my code look right?
-----Original Message-----
From: Broussard, Chris (CAP, VFS) [mailto:Chris.Broussard@gecapital.com]
Sent: Thursday, June 29, 2000 5:47 PM
To: 'Peter Benoit'
Subject: RE: [PHP] Increment
no problem,
chris
-----Original Message-----
From: Peter Benoit [mailto:pbenoit@triton-network.com]
Sent: Thursday, June 29, 2000 4:38 PM
To: 'Broussard, Chris (CAP, VFS)'
Subject: RE: [PHP] Increment
Argh!
should have put
if(whatever)
$i++;
Getting tired :)
-----Original Message-----
From: Broussard, Chris (CAP, VFS) [mailto:Chris.Broussard@gecapital.com]
Sent: Thursday, June 29, 2000 5:44 PM
To: 'Peter Benoit'
Subject: RE: [PHP] Increment
hope this helps,
for($i=1;$i<$whatever;$i++)
{
// whatever
}
echo("$i");
chris
-----Original Message-----
From: Peter Benoit [mailto:pbenoit@triton-network.com]
Sent: Thursday, June 29, 2000 4:34 PM
To: PHP-General
Subject: [PHP] Increment
$i = 1;
for(whatever){
$i++;
}
echo $i
I want $i to increment, how is this done correctly in PHP?
TIA,
Peter
--
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
To contact the list administrators, e-mail: php-list-admin@lists.php.net