- var_export: documentation ( source)
- array_filter: documentation ( source)
- sort: documentation ( source)
- preg_split: documentation ( source)
<?php
$x = ' \pm \cap \diamond \oplus
\mp \cup \bigtriangleup \ominus
\times \uplus \bigtriangledown \otimes
\div \sqcap \triangleleft \oslash
\ast \sqcup \triangleright \odot
\star \vee \lhd \bigcirc
\circ \wedge \rhd \dagger
\bullet \setminus \unlhd \ddagger
\cdot \wr \unrhd \amalg
';
$x = array_filter(preg_split('/\s+/', $x));
sort($x);
foreach ($x as $xx) {
var_export($xx);echo ",\n";
}