I have an associative array in PHP. i want to change position of an array index and its value.
Array
(
[savedRows] => 1
[errors] => Array
(
[0] => System has Skipped this row, because you have enter not valid value "" for field "description" in sheat "Electronics Laptops" row number "4"
)
[success] => successfully saved.
)
to like this
Array
( [savedRows] => 1 [success] => successfully saved. [errors] => Array ( [0] => System has Skipped this row, because you have enter not valid value "" for field "description" in sheat "Electronics Laptops" row number "4" ) )
i want to change ["errors"] index position from second to last and [success] index position at second when ever this array build. This is a dynamic array not a static it builds when a function call on function return i am getting this array.