I have an array called $myarray that might look like this:
Array
(
[221] => suspended-suspended-1
[691] => knee-ir-1
[812] => knee-ir-4
)
Below, I am checking to see if an id exists as a key (691 for example) and if so, I then want to do another check to see if the string "ir" exists for that key. Not just anywhere in the array, it has to be next to 691, for example (i.e. on the specific line).
$row['id']=691; //for example
if (array_key_exists($row['id'], $myarray)) {
if (in_array("ir", $myarray)){
//ill do some stuff here if "ir" exists
} else {
}
}
Obviously, what I wrote will look for "ir" anywhere in the array, but how do I look only within the info associated with key "691"?