Function to calculate the average of even numbers
< ? php function averageEven ( $ n ) { if ( $ n % 2 != 0 ) { echo ( " Invalid ▁ Input " ) ; return -1 ; } $ sum = 0 ; $ count = 0 ; while ( $ n >= 2 ) {