Reputation: 3103
I have 2 arrays like those:
$a = array(152,32,113,47,53); $b = array("a","w","lk","qw","ol");
I will sort $a by using asort() and I want to auto-sort the second array $b likewise $a.
How to do I?
Upvotes: 0
Views: 118
Reputation: 25614
https://www.php.net/manual/en/function.array-multisort.php
Upvotes: 3
Reputation: 6580
You can use array_multisort.
Upvotes: 7