$str = "yazi";
$count = strlen($str);
for($i = 0; $i < $count; $i++) {
    echo $str[$count - $i - 1];
}