I have 2 arrays with numerical indices that have the same number of keys and similar but not identical values. $unordered has the unordered data, whereas array $ordered has the data in the proper order. I want to sort $unordered in the same order as $ordered, but keep the percentage values in square brackets from $unordered.
$unordered:
[0] => "Horse [1%]"
[1] => "Cat [5%]"
[2] => "Dog [94%]"
$ordered:
[0] => "Cat"
[1] => "Horse"
[2] => "Dog"
Thanks.