fork download
  1. <?php
  2.  
  3. $result=0;
  4. $numero = 123456789;
  5. $num = str_split($numero, 1);
  6.  
  7. for ($i=0;$i<count($num);$i++){
  8.  
  9. $result += $num[$i];
  10.  
  11. }
  12.  
  13. echo $result;
Success #stdin #stdout 0.01s 82560KB
stdin
Standard input is empty
stdout
45