Re: Array help

From: Date: Mon, 31 Jul 2000 04:50:34 +0000
Subject: Re: Array help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-9121@lists.php.net to get a copy of this message
> can some on show me a example of how to make a array loop until it finds the correct element in the array. a simple example $arr_size = count($your_array); for($i=0 ; $i<arr_size ; $i++) if ($your_array[$i] == "something") echo "Bingo\n"; break; // if you don't think you need to continue after finding the first occurance of 'something' } }

« previous php.general (#9121) next »