I use in_array() to check whether a value exists in an array like below,
$a = array(\"Mac\", \"NT\", \"Irix\", \"Linux\");
if (in_array(\"Irix\"
Shorter version, for multidimensional arrays created based on database result sets.
function in_array_r($array, $field, $find){
foreach($array as $item){
if($item[$field] == $find) return true;
}
return false;
}
$is_found = in_array_r($os_list, 'os_version', 'XP');
Will return if the $os_list array contains 'XP' in the os_version field.