I have an array which holds around 5000 array elements, each in the following format:
Array
(
[keywordid] => 98
[keyword] => sample keyword 34
[type] => NATURAL
[longname] => UK
)
I have a second array which holds numerical values such as the following:
Array
(
[0] => 55
[1] => 56
[2] => 57
[3] => 58
[4] => 59
[5] => 1065
[6] => 1066
[7] => 1067
[8] => 1083
)
Each value in the array above corresponds to the 'keywordid' value within each array of the first array. I want to sort the first array, so that those arrays whose keywordid has a value matching an element in the second array, appear first and the rest of the arrays appear afterwards in no specified order. How do I accomplish this? I am using PHP 5.3, backwards compatibility is not a requirement.
Appreciate the help.