View Single Post
Old 11-08-2007, 09:51 AM   #7 (permalink)
bluesaga
Super Moderator
Advanced Programmer 
 
bluesaga's Avatar
 
Join Date: Sep 2007
Posts: 165
Thanks: 0
bluesaga is on a distinguished road
Default

Tanax, while that is correct it is not the cleanest approach to doing that.

PHP Code:
// Loops through the array, where $c is the value of the current element
foreach($b as $c) {

   if(
$c == $a) {
     break;
   }

   
// Optional, if the current element was NOT a match to the $a value


The above just breaks the loop after its found once, muchos cleaner, if you didn't want to break the loop, you could use "continue;" instead and have it skip the rest of the document that way and go through the next element in the array.
__________________
Halo 3 Cheats
bluesaga is offline  
Reply With Quote