How would you write a sorting routine in PHP that would replace the values of an array's keys, with another array's key value's if the former array's key value's are out of order.
$array1 = ['section2', 'section3', 'section1'];
$array2 = ['content for section1', 'content for section2', 'content section3'];
How could I replace the values of $array1 with the corrosponding content in $array2?
So I guess what I'm asking is how can I make $array1 display the following....
content for section2
content for section3
content for section1
in that order.
section2?section1has a link or reference forsection2? Why you don't want to have the second array like this:$array2 = ['section1'=>'content for section1', 'section2'=>'content for section2', ... etc]? You need to have strong relationship between this two arrays.