0

I have two array and I want to arrange one of them based on the other one.

$sortMe = Array
(
    [0] => 100
    [1] => 1
    [2] => 10
    [3] => 1000
)

$example = Array
(
  [0] => 1
  [1] => 1000
  [2] => 100
  [3] => 10
)

how can I sort the $sortMe array based on $example to:

$sortMe = Array
(
    [1] => 1
    [3] => 1000
    [0] => 100
    [2] => 10
)
C123D
  • 51
  • 5
  • 2
    The first dupe is generalized, the second is more specific. Demo of advice on 1st dupe target: https://3v4l.org/gbbua or my preference on the 2nd: https://3v4l.org/THTAY – mickmackusa Jan 13 '23 at 05:20

0 Answers0