public static function getRectangle(array $array, $row, $col, $height,
                                        $width)
    {
        $rec = array();
        for ($y = $row; $y < $row + $height; $y++) {
            $rec[] = array_slice($array[$y], $col, $width);
        }
        return $rec;
    }
public static function getRectangle(array $array, $row, $col, $height,
                                        $width)
    {
        $rec = array();
        for ($y = $row; $y < $row + $height; $y++) {
            $rec[] = array_slice($array[$y], $col, $width);
        }
        return $rec;
    }
public static function getRectangle ( array $ array , $ row , $ col , $ height , $ width ) { $ rec = array ( ) ; for ( $ y = $ row ; $ y < $ row + $ height ; $ y ++ ) { $ rec [ ] = array_slice ( $ array [ $ y ] , $ col , $ width ) ; } return $ rec ; }
Returns a rectangle of a two-dimensional array.

@param array   $array   The array to extract the rectangle from.
@param integer $row     The start row of the rectangle.
@param integer $col     The start column of the rectangle.
@param integer $height  The height of the rectangle.
@param integer $width   The width of the rectangle.

@return array  The extracted rectangle.
Returns a rectangle of a two - dimensional array .