Skip to content

Instantly share code, notes, and snippets.

View poohspear's full-sized avatar

Poohspear poohspear

View GitHub Profile
@poohspear
poohspear / 0_reuse_code.js
Created July 25, 2017 04:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@poohspear
poohspear / uni_zawgyi_detect.php
Created April 12, 2018 05:27
ZawGyi or Unicode detect in php
<?php
function test_zg_or_uni($content){
$regexUni = '/[ဃငဆဇဈဉညဋဌဍဎဏဒဓနဘရဝဟဠအ]်|ျ[က-အ]ါ|ျ[ါ-း]|\x{103e}|\x{103f}|\x{1031}[^\x{1000}-\x{1021}\x{103b}\x{1040}\x{106a}\x{106b}\x{107e}-\x{1084}\x{108f}\x{1090}]|\x{1031}$|\x{1031}[က-အ]\x{1032}|\x{1025}\x{102f}|\x{103c}\x{103d}[\x{1000}-\x{1001}]|ည်း|ျင်း|င်|န်း|ျာ|င့်/u';
$regexZG = '/\s\x{1031}| ေ[က-အ]်|[က-အ]း/u';
$regexMM = '/[\x{1000}-\x{109f}\x{aa60}-\x{aa7f}]+/u';
if(preg_match($regexUni,$content))
return "Unicode";
else if(preg_match($regexZG,$content))
return "ZawGyi";