1. Go to this page and download the library: Download ageekdev/laravel-num 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/ */
ageekdev / laravel-num example snippets
Num::convert('1234๑๒๓๔','mm','en');
// ၁၂၃၄๑๒๓๔
Num::toMyanmar('1234๑๒๓๔');
// ၁၂၃၄၁၂၃၄
Num::toThai('1234');
// ๑๒๓๔
Num::toEnglish('၁၂၃၄');
// 1234
num_to_mm('1234');
// ၁၂၃၄
num_to_th('1234');
// ๑๒๓๔
num_to_eng('၁၂၃၄');
// 1234
use AgeekDev\Num\Facades\Num;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Num::macro('toMyanmarShan', function (int|string|null $string, string $from = null) {
return Num::convert($string, 'shan', $from);
});
}