Hi,
I am having a rather frustrating time with a script I am working on.
I am looping through the elements of an array with a foreach statment
and inside the foreach statement I have two if statements.
An an example:
foreach ($a as $b) {
if ($b == $value1) {
statement1;
}
if ($b == $value2) {
statement2;
}
}
If I replace $value1 and $value2 with actual values, both if statements
are tested. However is I leave things as they are using varibles
containing the values I want to check for only the first if statement
is tested. It is acting as though it is breaking out of the foreach
when the first if statement evaluates to true. This does not happen
with actual values in place of $value1 and $value2 variables.
If anyone can shed light on this problem, the help is greatly
appreciated.
TIA,
Adam