Find the sum of the series 1 + 11 + 111 + 1111 + ... . . upto n terms | Function for finding summation ; Driver Code
< ? php function summation ( $ n ) { $ sum ; $ sum = ( pow ( 10 , $ n + 1 ) - 10 - ( 9 * $ n ) ) / 81 ; return $ sum ; } $ n = 5 ; echo summation ( $ n ) ; ? >