<?php $a = 9999; echo dig($a); function dig($z) { for ($i=0;$i<strlen($z);$i++) $b = $b + substr($z,$i,1); return $b; } ?>