Answer the question
In order to leave comments, you need to log in
`
How to rebuild an array?
Hello, I have such a situation, I get an array like this:
{ ["Name_Brand"]=> "Maxwill`s" ["Name"]=> "ShoriaSummer" }
{ ["Name_Brand"]=> "Maxwill` s" ["Name"]=> "Black"}
{ ["Name_Brand"]=> "Maxwill`s" ["Name"]=> "Altay"}
{ ["Name_Brand"]=> "Maxwill`s salt " ["Name"]=> "ShoriaSummer"}
{ ["Name_Brand"]=> "Maxwill`s salt" ["Name"]=> "Black"}
{ ["Name_Brand"]=> "Maxwill`s salt " ["Name"]=> "Altay"}
{ ["Name_Brand"]=> "Taboo" ["Name"]=> "Queen"}
{ ["Name_Brand"]=> "Taboo" ["Name"]=> "Origin"}
{ ["Name_Brand"]=> "Taboo" ["Name"]=> "Aida"}
{ [" Name_Brand"]=> "Taboo" ["Name"]=> "Eva"}
From this array in php, you need to make Name_Brand become like an id, for example like this:
{["Maxwill`s"] => {["Name"]=> "ShoriaSummer"},{["Name"]=> "Black"},{["Name"]=> "Altay"}}
{ ["Maxwill`s salt"] => {["Name"]=> "ShoriaSummer"},{["Name"]=> "Black"},{["Name"]=> "Altay"}}
{ ["Taboo"] => {["Name"]=> "Queen"},{["Name"]=> "Origin"},{["Name"]=> "Aida"},{["Name "]=> "Eva"}}
I apologize in advance for the unclear explanation of the assignment...
Answer the question
In order to leave comments, you need to log in
It is better to get it right away in the right form
https://phpdelusions.net/pdo/fetch_modes#FETCH_GROUP
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question