Driver Code
$ arr = array ( 5 , 4 , 2 , 3 , 1 , 6 ) ; $ n = count ( $ arr ) ; if ( areConsecutive ( $ arr , $ n ) == true ) echo " Array ▁ elements ▁ are ▁ consecutive ▁ " ; else echo " Array ▁ elements ▁ are ▁ not ▁ consecutive ▁ " ; ? >