Jump to content

Recommended Posts

from a book

 

<!DOCTYPE html PUBLIC 
  "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>If...Else</title>
<meta http-equiv="content-type" 
	content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />

  </head>
  <body>

<?php

for ($i=1; $i<=100; $i++ {
echo "I must not use PHP to write my lines." ;
}

?>
  </body>
  </html>
  

 

It's throwing up an error saying it expects a ")" on line 16 (the for line) when it's obviously right there!!

Any ideas why this isn't working/

Is the book giving me wrong instructions?

 

Help

 

Makes perfect sense. The semicolon is used to delimit the parameters so it only needs to go between the parameters. I have never seen anything like the first example in any language I have used. It is not just a PHP thing.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.