I’m trying to restructure an array but can’t figure out how to rearrange it to output the id as the key, I want to change this:
Array
(
[0] => Array
(
[0] => 16
[1] => News
[2] => News
[3] => News
[4] => News content
)
[1] => Array
(
[0] => 17
[1] => about-us
[2] => About us
[3] => About us
[4] => About us content
)
)
To this:
Array
(
[16] => Array
(
[0] => News
[1] => News
[2] => News
[3] => News content
)
[17] => Array
(
[0] => about-us
[1] => About us
[2] => About us
[3] => About us content
)
)
I created this demo script. This should work.
Output: