Check in binary array the number represented by a subarray is odd or even | prints if subarray is even or odd ; if arr [ r ] = 1 print odd ; if arr [ r ] = 0 print even ; Driver code
< ? php function checkEVENodd ( $ arr , $ n , $ l , $ r ) { if ( $ arr [ $ r ] == 1 ) echo " odd " , " STRNEWLINE " ; else echo " even " , " STRNEWLINE " ; } $ arr = array ( 1 , 1 , 0 , 1 ) ; $ n = sizeof ( $ arr ) ; checkEVENodd ( $ arr , $ n , 1 , 3 ) ; ? >