I have this kind of multi-dimensional array
Array
(
[return] => Array
(
[0] => Array
(
[0] => Array
(
[911111111111] => 1
)
)
)
[error_row] => Array
(
[0] => 911111111111
)
)
The problem is I got an error
Message: Invalid argument supplied for foreach()
So I tried to put an (array) in foreach()
so far what I tried is
foreach((array)$check_cloud_id_exist as $key)
{
foreach((array)$key as $subkey){
foreach((array)$subkey as $childkey){
foreach((array)$childkey as $childitem => $childs){
//code here
}
}
}
}
It gives me a loop array with one element containing the boolean value as an int which is not present in [error_row]
recursivefunction to get proper values.[return]which is 1 and end of[error_row]which is 911111111111