Sum of the series ( 1 * 2 ) + ( 2 * 3 ) + ( 3 * 4 ) + ... ... upto n terms | Function to return sum ; Driver code
< ? php function sum ( $ n ) { return $ n * ( $ n + 1 ) * ( $ n + 2 ) / 3 ; } $ n = 2 ; echo sum ( $ n ) ; ? >