Having trouble with "<<<_END"

I am new to PHP.

I have the following code…
[php]<?php
$myString = “This is my String”;

echo <<<_END

This is a test

$myString



_END;
?>[/php]

Which is generating the following error…
PHP Parse error: syntax error, unexpected $end in /Applications/MAMP/htdocs/hipBondage/test.php on line 12

Line 12 is “_END;”

I have googled the error message but the 2 primary things that seem to cause it do not apply here…

  1. Unclosed “}” - No curly braces at all at least in my code.
  2. Whitespace in front of_END; I edited this entire thing in both Dashcode and Textedit making sure it was the first thing on the line.

I am running in MAC with MAMP 2.0.5
Apache 2.2.21
PHP 5.2.17

Can anyone offer advice?

You have a space after the ; on the line with _END; This is causing the error.

That did it. Thanx. So you cannot have whitespace characters either before or after this line?

Sponsor our Newsletter | Privacy Policy | Terms of Service