Array-like this:
Array
(
[0] => Array
(
[0] => <img s
[1] => Ric
[2] => 130
[3] => 608
)
[1] => Array
(
[0] => In Stock
[1] => 10 lb
[2] => <img src=
[3] => Rice La
)
)
What I want is to convert this complex array into a simple one, so in the end, I can get this result:
Array
(
[0] => <img s
[1] => Ric
[2] => 130
[3] => 608
[4] => In Stock
[5] => 10 lb
[6] => <img src=
[7] => Rice La
)
I really tried a lot of different codes and helps that I found on the internet like this:
function array_flatten($array) {
if (!is_array($array)) {
return FALSE;
}
$result = array();
foreach ($array as $key => $value) {
if (is_array($value)) {
$result = array_merge($result, array_flatten($value));
}
else {
$result[$key] = $value;
}
}
return $result;
}
This didn't help me at all. Does someone know which method I can try to solve this problem? This didn't help me at all. Does someone know which method I can try to solve this problem?