Skip to content

Instantly share code, notes, and snippets.

@l0l3r
Last active January 20, 2019 13:52
Show Gist options
  • Save l0l3r/31241a122139a40b4badd43eb973693d to your computer and use it in GitHub Desktop.
Save l0l3r/31241a122139a40b4badd43eb973693d to your computer and use it in GitHub Desktop.
<?php
function convertGeoToLat($str, $viceversa = false){
$geo = array(
'ა',
'ბ',
'გ',
'დ',
'ე',
'ვ',
'ზ',
'თ',
'ი',
'კ',
'ლ',
'მ',
'ნ',
'ო',
'პ',
'ჟ',
'რ',
'ს',
'ტ',
'უ',
'ფ',
'ქ',
'ღ',
'ყ',
'შ',
'ჩ',
'ც',
'ძ',
'წ',
'ჭ',
'ხ',
'ჯ',
'ჰ'
);
$lat = array(
'a',
'b',
'g',
'd',
'e',
'v',
'z',
't',
'i',
'k',
'l',
'm',
'n',
'o',
'p',
'zh',
'r',
's',
't',
'u',
'f',
'k',
'g',
'y',
'sh',
'ch',
'c',
'dz',
'w',
'ch',
'x',
'j',
'h'
);
if(!$viceversa) {
$str = str_replace($geo,$lat, $str);
} else {
$str = str_replace($lat,$geo, strtolower($str));
}
return $str;
}
echo convertGeoToLat('რაღაცა 177');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment