PHP array printing using a loop
arrays, loops, php
Solution
$array = array("Jonathan","Sampson");
foreach($array as $value) {
print $value;
}
or
$length = count($array);
for ($i = 0; $i < $length; $i++) {
print $array[$i];
}
Problem
If I know the length of an array, how do I print each of its values in a loop?