0

<?php $names = array("John", "David", "Amy"); foreach ($names as $name) { echo $name.'<br />'; } ?>.

In this question foreach($names as $name)

9th Aug 2019, 2:34 AM
Rajat Khatore
Rajat Khatore - avatar
1 Antwort
+ 8
Rajat Khatore hi, In this foreach loop executes as many times as there are values in the given array ($names). Each time it's run it stores the current value in the given variable ($name). $name can then be used inside the foreach-block. Also, $name is probably read-only which is used for reading the name present in the $names array.
9th Aug 2019, 2:52 AM
GAWEN STEASY
GAWEN STEASY - avatar