Skip to content
Advertisement

how to change array structure in laravel?

Hello everyone i get some problem when try learn php with laravel, there is the problem …

i have an array structure like this :

JavaScript

how can u change the array structure to look like this :

JavaScript

im newb ,can somebody help me, im using laravel 5.8 ,very grateful if someone helps. sorry for my broken english.

Advertisement

Answer

i found it !

use array_chunck()

JavaScript

output:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement