Good my problem is the following I have this arrangement
Array(
[Codigo] => TOTAL
[Descripcion] =>
[L1] => 45
[L2] => 50
[L3] => 40
[total] => 136
[web] => 1
[CDC+CI] => 130)
I need [CDC+CI] to be before the [total] I would really appreciate your help
You can use the array_reverse function :
This way you would reverse the order of the elements in the array:
but if you want to move a specific element within the array to another position within the array , you can use the array_splice function :
for example move the element index 7 to the first position
to get: