The following snippet will put the individual digits into an array after that it's should be a case of working on the elements of the array. Element 0-2 hundreds, 3-5 thousands, 6-8 millions etc. Obviously some refining is required to cater for the numbers between ten and twenty.
<?php
$digit = array();
$number = 123654879;
$num = $number;
$n = 0;
while($num!= 0)
{
$digit[$n] = $num%10;
$num=(int)($num/10);
$n++;
echo "n = $n, num = $num<BR>";
} // while
echo $number;
echo "<PRE>";
var_dump($digit);
echo "</PRE>";
?>graeme
susilo wrote:
Does everyone know how to convert Nominal Number into string spelling in PHP ?.
Like this :
Nominal Number : 567.123.560
And the spelling string/word have to be like this :
"Five Hundred Sixty Seven Million One Hundred Twenty Three Thousand Five Hundred and Sixty"
Please help me..
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
