Some time ago during a job interview I got the task to reverse a string in PHP without using strrev.
strrev
My first solution was something like this:
you can try this..
$string = "NASEEM"; $total_word = strlen($string); for($i=0; $i<=$total_word; $i++) { echo substr($string,$total_word-$i,1); }