+ 1
can you help me fix this simple loop code
<?php $names = array("David", "Amy", "John"); echo $names[1]; for ($a=0;$a<3;$a++) { echo $names[a];} ?>
2 Answers
+ 6
<?php
$names = array("David", "Amy", "John");
echo $names[1];
for ($a=0;$a<3;$a++)
{ echo $names[$a];}
?>
+ 2
can you help me fix this simple loop code
<?php
$names = array("David", "Amy", "John");
echo $names[1];
for ($a=0;$a<3;$a++)
{
echo $names[a]; // out of scoap
}
?>