Program to find sum of harmonic series | PHP program to find sum of harmonic series using recursion ; Base condition ; Driver Code
< ? php function sum ( $ n ) { if ( $ n < 2 ) return 1 ; else return 1 / $ n + ( sum ( $ n - 1 ) ) ; } echo sum ( 8 ) . " STRNEWLINE " ; echo sum ( 10 ) ; ? >