Hello! The task is as follows: there are two arrays, one with text, the second with numbers defining the position of this text. For clarity:
$a = array(1,2,3,4,5); $b = array('1a','2b','3c','4d','5e'); Array "a" can be changed and depending on this you need to sort the array "b". when mixing can come out like this:
$a = array(5,2,4,1,3); $b = array('5e','2b','4d','1a','3c'); But I can not find a function that would do it "from the box", but for some reason there is a "chuyka" that is similar. For example, now I did this:
$i = 0; foreach ($b as $value) { $c[$a[$i]] = $b[$a[$i++]]; } And, in principle, I got what I wanted, but is the question still an out-of-box solution?