Skip to content

Instantly share code, notes, and snippets.

@tuxmartin
Created December 11, 2015 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuxmartin/9bf5e916d521202c04d1 to your computer and use it in GitHub Desktop.
Save tuxmartin/9bf5e916d521202c04d1 to your computer and use it in GitHub Desktop.
Razeni UTF-8 retezcu v PHP zacinajicich diakritickym znakem
<?php
setlocale(LC_COLLATE, 'cs_CZ.utf8');
$array = array("žragsg", "chodźić", "přidać", "ágščgš", "ćehnyć", "łopjeno");
usort($array, 'strcoll');
echo "<pre>";
print_r($array);
echo "/<pre>";
?>
<hr>
<strong>
<p>Vystup na mem pc:</p>
<pre>
Array
(
[0] => ágščgš
[1] => ćehnyć
[2] => chodźić
[3] => łopjeno
[4] => přidać
[5] => žragsg
)
/
</pre>
</strong>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment