|
Posted by Alvaro G Vicario on 06/28/05 11:02
*** Adam wrote/escribió (27 Jun 2005 21:13:04 -0700):
> 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.
Your pseudo-code looks correct, so the problem must in the actual code you
don't paste.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Navigation:
[Reply to this message]
|