Is there a way on PHP where I can get the arrangement of the strings inside $input
array:
$input = array(3) {
[0]=>
string(3) "one"
[1]=>
string(3) "two"
[2]=>
string(5) "three"
}
Then use the $reference
array as reference for the equivalent
$reference = array(3) {
[0]=>
array(2) {
[0]=>
string(1) "2"
[1]=>
string(3) "two"
}
[1]=>
array(2) {
[0]=>
string(1) "3"
[1]=>
string(5) "three"
}
[2]=>
array(2) {
[0]=>
string(1) "1"
[1]=>
string(3) "one"
}
}
And result to the $output
array?
$output = array(3) {
[0]=>
string(3) "1"
[1]=>
string(3) "2"
[2]=>
string(5) "3"
}