sum of digit and reverse print digit in PHP

This program is sum of given digit and print reverse digit

<?php
    $n="45783";
 $len=strlen($n);
 $sum=0;
 for($i=0;$i<$len;$i++)
 {
   $sum=$sum+$n[$i];
   }
   echo "Digit sum is ".$sum;
   echo "<br>";
   echo "Reverse print digit = ";
   for($j=$len-1;$j>=0;$j--)
   {
     echo $n[$j];
      }

?>

Labels: