Hi,
I'm trying to sort a "conditional" multidim-array
Here's the code + array
So I would like to sort the strings that met the conditions (ASC)
I obviously get this right now:
aber
abom
abdo
instead of
abdo
aber
abom
Any input would be appreciated...
I'm trying to sort a "conditional" multidim-array
Here's the code + array
Code:
$Pages = array(
1 => array (
"Title" => "Title 1",
"Words" => "aber,abom,dee" ),
2 => array (
"Title" => "Title 2",
"Words" => "abdo,text,type" ),
);
Code:
foreach ($Pages as $key=>$Page) {
$myWords = explode(",", $Page['Words']);
array_multisort($myWords, SORT_ASC);
foreach ($myWords as $myWord) {
$myFirstLetter = $myWord{0};
if ($myFirstLetter == "a") {
echo "<a href=\"[URL unfurl="true"]http://something.come\">{$myWord}</a>[/URL] <br>";
}
}
}
So I would like to sort the strings that met the conditions (ASC)
I obviously get this right now:
aber
abom
abdo
instead of
abdo
aber
abom
Any input would be appreciated...