Skip to content

Instantly share code, notes, and snippets.

@reazul-islam
Created May 23, 2022 17:40
Show Gist options
  • Select an option

  • Save reazul-islam/2deb8512de5af0990bee8be92d39b55b to your computer and use it in GitHub Desktop.

Select an option

Save reazul-islam/2deb8512de5af0990bee8be92d39b55b to your computer and use it in GitHub Desktop.
English format to bangla on the run time
<?php
class Helper
{
public static $bn = ['১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯', '০'];
public static $en = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];
public static function bn2en($number)
{
return str_replace(self::$bn, self::$en, $number);
}
public static function en2bn($number)
{
return str_replace(self::$en, self::$bn, $number);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment