Re: search array for value

From: Date: Tue, 31 Jul 2001 04:39:30 +0000
Subject: Re: search array for value
Groups: php.general 
Request: Send a blank email to php-general+get-60313@lists.php.net to get a copy of this message
In a message dated 7/31/01 12:32:59 AM Eastern Daylight Time, matt@adplusonline.com writes: > How do I search an array? > > For example if I want to know if $array contains "1"... > > Regards, > > Matthew Delmarter > for ($i = 0; $i < count($array); $i++) { if ($array[$i] == 1) { //do something exit; } }

« previous php.general (#60313) next »