I have a 2D array wherein each row is an associative array (which has keys that are 
column names of
a certain MySQL table)
the array name is "sess_arrayPhotos".
I need to match PhotoId (2nd dimension key) for every row (numeric index) of the 2D 
array.

I tried--
$keyPos=array_search($searchedforId,$sess_arrayPhotos);
--but that didn't work.

Right now, I am achieving it by:

 $sess_arrind=0;
  while(($sess_arrayPhotos[$sess_arrind]["PhotoId"] <> $photo) && ($sess_arrind <
sizeof($sess_arrayPhotos)))
  {
       next($sess_arrayPhotos);
       $sess_arrind=$sess_arrind+1;
  }
$keyPos=$sess_arrind;

I would like to know if there is a way of doing this using array_search().

-in anticipation
-Naintara



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to