By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,831 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,831 IT Pros & Developers. It's quick & easy.

If statement trouble

P: n/a
I'm having trouble with this if statement:

if($line[$c]=$ignore
{
$num--;
}
$ignore is defined as the string "ig"

$line is an array containing 5 items, some of which may be "ig"

$num starts out as a number representing the number of values in $line
The if statement you see above is nested inside a small for loop that
simply runs throught the process 5 times, and goes through the array
$line. At each point it is SUPPOSED to check and see if the current
value of $line at that particular slot ($c) is equal to "ig". If so,
then it decrements $num by 1.

My problem is it doesn't seem to care whether or not $line[$c] equal
"ig" or not. It's just decrementing $num all willy nilly.

AceX
Feb 25 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.