Jump to content

[SOLVED] an error in such a simple piece of code that i can't believe it


ryanthegecko

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.

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.