Jump to content

Question about using colon syntax in for loop


eldan88

Recommended Posts

Hey Guys. I am trying to use the colon sytanx for a for loop.. but I keep getting the following error. Parse error: syntax error, unexpected '=', expecting ';' in /Applications/XAMPP/xamppfiles/htdocs/Sandbox/select.php on line 4

 

Im not sure what I am doing wrong here. Thanks

<select>
<?php for (i=1; i<5; i++):
 echo "<option> </option>"
 ?>
<?php endfor ?>

</select>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.