Skip to content

Instantly share code, notes, and snippets.

View lex0000's full-sized avatar

lex0000

View GitHub Profile
@lex0000
lex0000 / thai.php
Created February 21, 2019 11:05 — forked from dtinth/thai.php
Utility function to fix floating tone marks when outputting as PDF.
<?php
function thai($x) {
$back = array(
"\xE0\xB9\x88" => "\xEF\x9C\x85",
"\xE0\xB9\x89" => "\xEF\x9C\x86",
"\xE0\xB9\x8A" => "\xEF\x9C\x87",
"\xE0\xB9\x8B" => "\xEF\x9C\x88",
"\xE0\xB9\x8C" => "\xEF\x9C\x89"
);
function thai($x) {
$back = array(
"\xE0\xB9\x88" => "\xEF\x9C\x85", //่(ไม้เอก)=>
"\xE0\xB9\x89" => "\xEF\x9C\x86", //้(ไม้โทร)=>
"\xE0\xB9\x8A" => "\xEF\x9C\x87", //๊(ไม้ตรี)=>
"\xE0\xB9\x8B" => "\xEF\x9C\x88", //+(ไม้จัตวา)=>
"\xE0\xB9\x8C" => "\xEF\x9C\x89" //์(ตัวการัน)=>
);
$cross = array();
$payanchana=array(