PHP code example of devhamidshahbazi / number-normalizer
1. Go to this page and download the library: Download devhamidshahbazi/number-normalizer 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/ */
devhamidshahbazi / number-normalizer example snippets
use NumberNormalizer\Facades\NumberNormalizer;
// Convert all supported languages
NumberNormalizer::toEnglish('قیمت: ۱۲۳۴ و ๑๒๓'); // قیمت: 1234 و 123
// Specific languages only
NumberNormalizer::toEnglish('۱۲۳ و ١٢٣', ['persian', 'arabic']);
// Custom mapping
NumberNormalizer::withMapping('۱۲۳', ['۱' => '1', '۲' => '2', '۳' => '3']);