I have an array i'm capturing from a textarea on a form.
Each line has this format:
Code: Select all
varA (space) varB|varCHere what I have:
Code: Select all
$array = split("\n",$listItems);
$count = count($array);
for ($x = 0;$x<$count; $x++) {
list($varX,$varC) = split("\|",$array[$x]);
list($varA,$varB) = split(" ",$varX);
}
$sortedArray = array_multisort($varB,SORT_STRING,SORT_DESC, $varA,$varC);
echo $sortedArray;Some of the examples I've seen have the array_multisort() inside the for loop. I can't get it to work.
Can someone point me in the right direction please?
Thanks!