-1

To make my question easier to understand, I will give an example output.

var_dump output:

Array 1:

array(22) { ["#HIDDEN_ID"]=> string(10) "08/11/2013"

Array 2:

array(22) { ["#HIDDEN_ID"]=> string(96) "www.google.co.uk....."

Array one is sorted by most recent date, however my second array is not but it has the same file ids.

Therefore I would like to sort my second array to how my first arrays file ids are stored.

I have no clue how to do this using uasort or usort.

1

1 Answer 1

1
$keys = array_keys($array1);

array_multisort($keys, SORT_ASC, $array2);
Sign up to request clarification or add additional context in comments.

1 Comment

Actually, while testing this it did not work. As Before I didnt have the same size arrays, now I do and it doesnt sort them

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.