text: Print reverse of a string using recursion | Function to print reverse of the passed string ; Driver Code
code: < ? php function reverse ( $ str ) { if ( ( $ str == null ) || ( strlen ( $ str ) <= 1 ) ) echo ( $ str ) ; else { echo ( $ str [ strlen ( $ str ) - 1 ] ) ; reverse ( substr ( $ str , 0 , ( strlen ( $ str ) - 1 ) ) ) ; } } $ str = " Geeks ▁ for ▁ Geeks " ; reverse ( $ str ) ; ? >