basic syntax question
Posted: 07 Jul 2011 18:12
i need to stop the whole loop for a certain condition. if condition is met the script must jump
to the next foreach token, test again and continue if it passes the test.
end 1 and break stop the whole script.
end does it right.
1. is this the right syntax?
2. is it valid for while loops either?
to the next foreach token, test again and continue if it passes the test.
end 1 and break stop the whole script.
end does it right.
Code: Select all
$base = "file 1,file 2,file 3,file 4";
foreach($file, $base, ",")
{
IF ($file == "file 3") { end; }
ELSEIF ($file != "file 3") { echo "$file"; }
}2. is it valid for while loops either?