Answer the question
In order to leave comments, you need to log in
How to move data from one array to another?
There are arrays of data, I need some fields from them, for example name, value. How can I get them out of there and add them to a new array?
Answer the question
In order to leave comments, you need to log in
$myData = [];
foreach ($items as $key => $item) {
$myData[$key] = [
'name' => $item['name'],
'value' => $item['value'],
];
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question