Exemple #1
0
 /**
  * @param $unit
  * @return string
  */
 public static function readThaiUnit($unit)
 {
     $number_count_thai = ["ศูนย์", "หนึ่ง", "สอง", "สาม", "สี่", "ห้า", "หก", "เจ็ด", "แปด", "เก้า"];
     $number = str_split("0123456789");
     $exploded = explode('.', $unit);
     print_r($number);
     if (count($exploded) > 1) {
         $txt = SELF::readThaiNumber($exploded[0]) . 'จุด' . str_replace($number, $number_count_thai, $exploded[1]);
     } else {
         $txt = SELF::readThaiNumber($unit);
     }
     return $txt;
 }