You can yes. There are a number of ways to determine this from filtering to iteration. Given what you have here though, is there a reason that the room_id isn't specified as the index for the outer array instead of as an item within the inner array?
I'd probably use a filter. The filter's only downside is its signature is not changeable, so you have to use global references in order to modify what you are looking for.
PHP Code:
function filterArray($item)
{
global $iRoomNum;
$bResult = false;
$roomID = (int)$iRoomNum;
if (is_array($item) && isset($item['room_id']) && $item['room_id'] == $roomID)
{
$bResult = true;
}
return $bResult;
}
$iRoomNum = 3;
$yourArray = Array (
Array ( 'room_id' => 3, 'room' => 'Living', 'affiliate_url' => 'link3' ),
Array ( 'room_id' => 1, 'room' => 'Kitchen', 'affiliate_url' => 'link1' ),
Array ( 'room_id' => 7, 'room' => 'Bed', 'affiliate_url' => 'link7' )
) ;
$aFiltered = array_filter($yourArray, 'filterArray');
print_r($aFiltered);