text: Program to check if matrix is lower triangular | PHP Program to check lower triangular matrix . ; Function to check matrix is in lower triangular form or not . ; Driver Code ; Function call
code: < ? php $ N = 4 ; function isLowerTriangularMatrix ( $ mat ) { global $ N ; for ( $ i = 0 ; $ i < $ N ; $ i ++ ) for ( $ j = $ i + 1 ; $ j < $ N ; $ j ++ ) if ( $ mat [ $ i ] [ $ j ] != 0 ) return false ; return true ; } $ mat = array ( array ( 1 , 0 , 0 , 0 ) , array ( 1 , 4 , 0 , 0 ) , array ( 4 , 6 , 2 , 0 ) , array ( 0 , 4 , 7 , 6 ) ) ; if ( isLowerTriangularMatrix ( $ mat ) ) echo ( " Yes " ) ; else echo ( " No " ) ; ? >