How do I do a 'Unit Total' using php? Let me explain:
$entered_data is an integer that could be of any number of digits e.g.
25487965.
To get the 'unit total' one would have to keep adding together all the digits until the answer is a single digit thus:
2+5+4+8+7+9+6+5 = 46
4+6 = 10
1+0 = 1
So, the unit total of 25487965 works out to 1
Similarly the unit total of 986879874 is 3.
Can someone help with a code to achieve this?
Thanks.