Today, We want to share with you convert number to words in php.In this post we will show you convert number to rupees in php, hear for Converts Number to Words in Indian currency format with paise value we will give you demo and example for implement.In this post, we will learn about PHP Converts currency into number with an example.
Convert number to words in PHP
Example 1: index.php
How to converts number to words using php - www.pakainfo.com '', 1 => 'One', 2 => 'Two', 3 => 'Three', 4 => 'Four', 5 => 'Five', 6 => 'Six', 7 => 'Seven', 8 => 'Eight', 9 => 'Nine', 10 => 'Ten', 11 => 'Eleven', 12 => 'Twelve', 13 => 'Thirteen', 14 => 'Fourteen', 15 => 'Fifteen', 16 => 'Sixteen', 17 => 'Seventeen', 18 => 'Eighteen', 19 => 'Nineteen', 20 => 'Twenty', 30 => 'Thirty', 40 => 'Forty', 50 => 'Fifty', 60 => 'Sixty', 70 => 'Seventy', 80 => 'Eighty', 90 => 'Ninety'); $here_digits = array('', 'Hundred','Thousand','Lakh', 'Crore'); while( $x < $count_length ) { $get_divider = ($x == 2) ? 10 : 100; $volume = floor($num % $get_divider); $num = floor($num / $get_divider); $x += $get_divider == 10 ? 1 : 2; if ($volume) { $add_plural = (($counter = count($string)) && $volume > 9) ? 's' : null; $amt_hundred = ($counter == 1 && $string[0]) ? ' and ' : null; $string [] = ($volume < 21) ? $change_words[$volume].' '. $here_digits[$counter]. $add_plural.' '.$amt_hundred:$change_words[floor($volume / 10) * 10].' '.$change_words[$volume % 10]. ' '.$here_digits[$counter].$add_plural.' '.$amt_hundred; }else $string[] = null; } $implode_to_Rupees = implode('', array_reverse($string)); $get_paise = ($volume_after_decimal > 0) ? "And " . ($change_words[$volume_after_decimal / 10] . " " . $change_words[$volume_after_decimal % 10]) . ' Paise' : ''; return ($implode_to_Rupees ? $implode_to_Rupees . 'Rupees ' : '') . $get_paise; } ?>How To Converts Number To Words Using Php - www.pakainfo.com
I hope you get an idea about converts decimal number to rupees in php.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.