Print Fibonacci Series in reverse order | PHP Program to print Fibonacci series in reverse order ; assigning first and second elements ; storing sum in the preceding location ; printing array in reverse order ; Driver COde
< ? php function reverseFibonacci ( $ n ) { $ a [ 0 ] = 0 ; $ a [ 1 ] = 1 ; for ( $ i = 2 ; $ i < $ n ; $ i ++ ) { $ a [ $ i ] = $ a [ $ i - 2 ] + $ a [ $ i - 1 ] ; } for ( $ i = $ n - 1 ; $ i >= 0 ; $ i -- ) { echo ( $ a [ $ i ] . " " ) ; } } $ n = 5 ; reverseFibonacci ( $ n ) ; ? >