1. Go to this page and download the library: Download abdulbaset/convert-numbers library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
abdulbaset / convert-numbers example snippets
use Abdulbaset\ConvertNumbers\ConvertNumbers;
// English (default)
echo ConvertNumbers::toWords(42); // "forty-two"
echo ConvertNumbers::toWords(1234.56); // "one thousand two hundred thirty-four point five six"
// Arabic
echo ConvertNumbers::toWords(42, 'ar'); // "اثنان و أربعون"
echo ConvertNumbers::toWords(1234.56, 'ar'); // "ألف و مائتان و أربعة و ثلاثون فاصلة خمسة ستة"
// French
echo ConvertNumbers::toWords(42, 'fr'); // "quarante-deux"
// Basic currency to words
echo ConvertNumbers::currencyToWords(1234.56, 'USD');
// "one thousand two hundred thirty-four dollars and fifty-six cents only"
// Arabic currency
echo ConvertNumbers::currencyToWords(1234.56, 'EGP', 'ar');
// "ألف و مائتان و أربعة و ثلاثون جنيه مصري و ستة و خمسون قرش فقط لا غير"
// Currency formatting
echo ConvertNumbers::currencyFormat(1234567.89, 'USD', 'en', true); // "1,234,567.89 $"
echo ConvertNumbers::currencyFormat(1234567.89, 'EGP', 'ar', true); // "١٬٢٣٤٬٥٦٧٫٨٩ ج.م"