I have the bellow multiple array:
array:4 [▼
0 => array:5 [▼
0 => "some content"
1 => "some content"
2 => "some content"
3 => "some content"
4 => "some content"
]
1 => array:5 [▼
0 => "some content"
1 => "some content"
2 => "some content"
3 => "some content"
4 => "some content"
]
2 => array:6 [▼
0 => "some content"
1 => "some content"
2 => "some content"
3 => "some content"
4 => "some content"
5 => "some content"
]
3 => array:5 [▼
0 => "some content"
1 => "some content"
2 => "some content"
3 => "some content"
4 => "some content"
]
]
How can I add keys to this array so it looks like:
array:4 [▼
0 => array:5 [▼
title => "some content"
subtitle => "some content"
somekey => "some content"
somekey2 => "some content"
somekey3 => "some content"
]
1 => array:5 [▼
title => "some content"
subtitle => "some content"
somekey => "some content"
somekey2 => "some content"
somekey3 => "some content"
]
2 => array:6 [▼
title => "some content"
subtitle => "some content"
somekey => "some content"
somekey2 => "some content"
somekey3 => "some content"
somekey4 => "some content"
]
3 => array:5 [▼
title => "some content"
subtitle => "some content"
somekey => "some content"
somekey2 => "some content"
somekey3 => "some content"
]
]
Is there any way to do it without for loop?
There isn't any way to add keys before because I don't know how many arrays will be create.
Thank you so much for your attention and participation.
foreachloop is what?