Answer the question
In order to leave comments, you need to log in
Forming 1 array in a foreach loop?
Help form an array of the form:
Array
(
[0] => 11;22
[1] => 11;22
[2] => 22;22
)
foreach ($arrrr as $element) {
if ($element->Brand == 'AAA' || $element->Brand == 'BBB') {
$element->Name;
$element->Brand;
$element->Price;
}
Array
(
[0] => $element->Name;$element->Brand;$element->Price;
[1] => $element->Name;$element->Brand;$element->Price;
[2] => $element->Name;$element->Brand;$element->Price;
)
$newarr = [];
foreach ($arrrr as $element) {
if ($element->Brand == 'AAA' || $element->Brand == 'BBB') {
$newarr[] = $element->One . ";" . $element->Ones;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question