Function to find mean of series .
< ? php function mean ( $ arr , $ n ) { $ sum = 0 ; for ( $ i = 0 ; $ i < $ n ; $ i ++ ) $ sum = $ sum + $ arr [ $ i ] ; $ mean = ( float ) ( $ sum / $ n ) ; return $ mean ; }