eldan88 Posted March 12, 2014 Share Posted March 12, 2014 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> Link to comment https://forums.phpfreaks.com/topic/286925-question-about-using-colon-syntax-in-for-loop/ Share on other sites More sharing options...
Zane Posted March 12, 2014 Share Posted March 12, 2014 PHP variables begin with a $ dollar sign. Link to comment https://forums.phpfreaks.com/topic/286925-question-about-using-colon-syntax-in-for-loop/#findComment-1472369 Share on other sites More sharing options...
eldan88 Posted March 12, 2014 Author Share Posted March 12, 2014 Oh yes thats right! I got it mixed up with javascript. Thanks Link to comment https://forums.phpfreaks.com/topic/286925-question-about-using-colon-syntax-in-for-loop/#findComment-1472372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.