$var=787878-7878;
echo substr($var, 0, 1)."<br>";
echo substr($var, 1, 1)."<br>";
echo substr($var, 2, 1)."<br>";
echo substr($var, 3, 1)."<br>";
e.t.c
or i guess you could put it in some kinda loop rather than counting each value.
hope that helps
Ant