Question:What is the best way to iterate through the $myarray array, assuming you want to modify the value of each element as you do?<?php
$myarray = array ("My String",
"Another String",
"Hi, Mom!");
?>
+ ExplanationNormally, the foreach statement is the most appropriate construct for iterating through an
array. However, because we are being asked to modify each element in the array, this option
is not available, since foreach works on a copy of the array and would therefore result in added overhead. Although a while loop or a do…while loop might work, because the array is sequentially indexed a for statement is best suited for the task, making Answer A correct: