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: 

A function DisplayArray($array) { foreach ($array as $value) { if (array_valid($value)) { DisplayArray($value); } else { echo $value. “<br>”; } } } DisplayArray($array); 

B function DisplayArray($array) { for ($array as $value) { if (valid_array($value)) { DisplayArray($value); } else { echo $value. “<br>”; } } } DisplayArray($array); 

C function DisplayArray($array) { for ($array as $value) { if (is_array($value)) { DisplayArray($value); } else { echo $value."<br>"; } } } DisplayArray($array); 

D function DisplayArray($array) { foreach ($array as $value) { if (is_array($value)) { DisplayArray($value); } else { echo $value "<br>"; } } } DisplayArray($array); 

+ Answer
+ Report
Total Preview: 802

Copyright © 2024. Powered by Intellect Software Ltd