Is there a more streamlined approach to checking for the presence of a number in a specific quadrant of a Sudoku array in PHP, rather than the current method being used in the function?

The current method of checking for the presence of a number in a specific quadrant of a Sudoku array in PHP involves iterating through the quadrant and comparing each element with the target number. A more streamlined approach would be to use array functions like array_filter or array_reduce to check for the presence of the number in the quadrant.

function isNumberInQuadrant($sudoku, $number, $row, $col) {
    $quadrant = [];
    $startRow = floor($row / 3) * 3;
    $startCol = floor($col / 3) * 3;
    
    for ($i = $startRow; $i < $startRow + 3; $i++) {
        for ($j = $startCol; $j < $startCol + 3; $j++) {
            $quadrant[] = $sudoku[$i][$j];
        }
    }

    return in_array($number, $quadrant);
}