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> Quote Link to comment https://forums.phpfreaks.com/topic/286925-question-about-using-colon-syntax-in-for-loop/ Share on other sites More sharing options...
Solution Zane Posted March 12, 2014 Solution Share Posted March 12, 2014 PHP variables begin with a $ dollar sign. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.