Sum of the series 0.6 , 0.06 , 0.006 , 0.0006 , ... to n terms | function which return the the sum of series ; Driver code
< ? php function sumOfSeries ( $ n ) { return ( 0.666 ) * ( 1 - 1 / pow ( 10 , $ n ) ) ; } $ n = 2 ; echo ( sumOfSeries ( $ n ) ) ; ? >