sundowatch
sundowatch

Reputation: 3103

php arrays sort

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

Answers (2)

awm
awm

Reputation: 6580

You can use array_multisort.

Upvotes: 7

Related Questions