PHP code example of mpco / english-persian-number
1. Go to this page and download the library: Download mpco/english-persian-number 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/ */
mpco / english-persian-number example snippets
use MPCO\EnglishPersianNumber\Numbers;
echo Numbers::toPersianNumbers('1513215'); // ۱۵۱۳۲۱۵
echo Numbers::toPersianNumbers('1513215', true); // ۱,۵۱۳,۲۱۵
echo Numbers::toEnglishNumbers('۱۵۱۳۲۱۵'); // 1513215
echo Numbers::toEnglishNumbers('۱۵۱۳۲۱۵', true); // 1,513,215