Driver code
$ str = " geeksforgeeks " ; $ x = ' e ' ; $ index = findLastIndex ( $ str , $ x ) ; if ( $ index == -1 ) echo ( " Character ▁ not ▁ found " ) ; else echo ( " Last ▁ index ▁ is ▁ " . $ index ) ; ? >