- strcmp: documentation ( source)
- array_filter: documentation ( source)
- preg_split: documentation ( source)
- usort: documentation ( source)
- strtolower: documentation ( source)
<?php
$x = '
U \yen X \checkmark r \circledR m \maltese
p \ulcorner q \urcorner x \llcorner y \lrcorner
99K \dashrightarrow L99 \dashleftarrow
\rightleftharpoons \ \angle
~ \hbar 0 \mho
< \sqsubset = \sqsupset
';
$x = array_filter(preg_split('/\s+/', $x));
usort($x, function ($a, $b) {
return strcmp(strtolower($a), strtolower($b));
});
foreach ($x as $xx) {
echo $xx, "\n";
}