Nth Even Fibonacci Number | Function which return nth even fibonnaci number ; calculation of Fn = 4 * ( Fn - 1 ) + Fn - 2 ; Driver Code
< ? php function evenFib ( $ n ) { if ( $ n < 1 ) return $ n ; if ( $ n == 1 ) return 2 ; return ( ( 4 * evenFib ( $ n - 1 ) ) + evenFib ( $ n - 2 ) ) ; } $ n = 7 ; echo ( evenFib ( $ n ) ) ; ? >