check the maximum product in diagonal going through down - right
if ( ( $ i - 3 ) >= 0 and ( $ j - 3 ) >= 0 ) { $ result = $ arr [ $ i ] [ $ j ] * $ arr [ $ i - 1 ] [ $ j - 1 ] * $ arr [ $ i - 2 ] [ $ j - 2 ] * $ arr [ $ i - 3 ] [ $ j - 3 ] ; if ( $ max < $ result ) $ max = $ result ; }