mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
flags function
This commit is contained in:
@@ -121,4 +121,15 @@ class Genfunctions
|
||||
}
|
||||
}
|
||||
|
||||
function country2flag($code) {
|
||||
$code = strtoupper($code);
|
||||
|
||||
$offset = 0x1F1E6;
|
||||
$code_p1 = $offset + ord($code[0]) - ord('A');
|
||||
$code_p2 = $offset + ord($code[1]) - ord('A');
|
||||
|
||||
$flag = mb_chr($code_p1, 'UTF-8') . mb_chr($code_p2, 'UTF-8');
|
||||
return $flag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user