Question: You have a 2D array in PHP:
$array = array(array(141,151,161), 2,3, array(101, 202, 303));
You want to display all the values in the array The correct way is:
Afunction DisplayArray($array) {
foreach ($array as $value) {
if (array_valid($value)) {
DisplayArray($value);
} else {
echo $value. “<br>”;
}
}
}
DisplayArray($array);
Bfunction DisplayArray($array) {
for ($array as $value) {
if (valid_array($value)) {
DisplayArray($value);
} else {
echo $value. “<br>”;
}
}
}
DisplayArray($array);
Cfunction DisplayArray($array) {
for ($array as $value) {
if (is_array($value)) {
DisplayArray($value);
} else {
echo $value."<br>";
}
}
}
DisplayArray($array);
Dfunction DisplayArray($array) {
foreach ($array as $value) {
if (is_array($value)) {
DisplayArray($value);
} else {
echo $value "<br>";
}
}
}
DisplayArray($array);
Note: Not available