You can loop directy on the display as
foreach ($result['display'] as $display) {
echo $display . '<br>';
}
But you can imbricate 2 loops
foreach ($result as $value) {
if (is_array($value)) {
foreach ($value as $display) {
echo '----' . $display . '<br>';
}
} else {
echo $value . '<br>';
}
}
The best solution is to use a function:
function displayArray($array)
{
foreach ($array as $each) {
if (is_array($each)) {
displayArray($each);
}
echo $each . '<br>';
}
}
So you can call the function like this:
displayArray($result);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…