Cannot run my first php script

I am trying to run my first php script on wamp/win7.
The wamp default page comes up fine, and phpinfo works, so the conf is ok.

When I try to run the following:

[code]<!doctype html>

PHP Test

This is an HTML line

<?php echo “

This is a PHP line

”; phpinfo(); ?> [/code]

I get the following error
Parse error: syntax error, unexpected ‘>’ in C:\wamp\www\first.php on line 9
Line 9 is the echo statement.
When, I remove the line, phpinfo comes up fine. I am unable to see what is wrong with that line.

Please help.

What editor are you using? It appears that your editor has added opening and closing speech mark characters which are different from " "s. PHP will only understand this speech mark: "

See fixed version: http://codepad.org/96pdlcaA

I would suggest Notepad++ for editing code in Windows.

Thanks! That did the job.

Sponsor our Newsletter | Privacy Policy | Terms of Service