Answer the question
In order to leave comments, you need to log in
how to change php array
Hello. Please help me change the array.
There is an array:
Array
(
[0] => Array
(
[id] => 111
[title] => title1
[name] => picture
[value] => img1.png
)
[1] => Array
(
[id] => 111
[title] => title1
[name] => width
[value] => 600
)
[2] => Array
(
[id] => 111
[title] => title1
[name] => height
[value] => 400
)
[3] => Array
(
[id] => 222
[title] => title2
[name] => picture
[value] => img2.png
)
[4] => Array
(
[id] => 222
[title] => title2
[name] => width
[value] => 800
)
)
Array
(
[0] => Array
(
[id] => 111
[title] => title1
[nv] => Array
(
[0] => Array
(
[name] => picture
[value] => img1.png
)
[1] => Array
(
[name] => width
[value] => 600
)
[2] => Array
(
[name] => height
[value] => 400
)
)
)
[1] => Array
(
[id] => 222
[title] => title2
[nv] => Array
(
[0] => Array
(
[name] => picture
[value] => img2.png
)
[1] => Array
(
[name] => width
[value] => 800
)
)
)
)
Answer the question
In order to leave comments, you need to log in
In a cycle.
you go through the original array and form the desired one.
But you don't need it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question