exit loop
Posted: Wed Feb 09, 2005 8:53 pm
i was wonder if there was a way to exit a for loop after one variable is equal to the other, i want the script to continue but i just want the loop to stop right there and then go to the next part of the script.
example:
example:
Code: Select all
$arrview = explode(",", $notviewd);
$countview = count($arrview);
for ($i=0; $i<$countview; $i++){
echo $arrviewї$i].' ';
if ($arrviewї$i] == $threadid){
if ($reply_count > '9'){
echo "<img src='img/new_post_hot.gif'>";
//exit loop here
}
if($accesslvl == '1'){
echo "<img src='img/new_post_lock.gif'>";
//exit loop here
}
if($reply_count < '9'){
echo "<img src='img/new_post.gif'>";
//exit loop here
}
}
}