function str_reverse($str) { for ($i = (strlen($str)-1);$i >= 0;$i--) { $str2 .= $str[$i]; } return $str2; }