<?php
$result=0;
$numero = 123456789;
for ($i=0;$i<count($num);$i++){
$result += $num[$i];
}
echo $result;
PD9waHAKCiRyZXN1bHQ9MDsKJG51bWVybyA9IDEyMzQ1Njc4OTsKJG51bSA9IHN0cl9zcGxpdCgkbnVtZXJvLCAxKTsKCmZvciAoJGk9MDskaTxjb3VudCgkbnVtKTskaSsrKXsKCiRyZXN1bHQgKz0gJG51bVskaV07CgkKfQoKZWNobyAkcmVzdWx0Ow==