PHP中的heredoc出错[重复]

This question already has an answer here:

This code:

<?
echo <<<EOM 
Hello
EOM;
?>

Results in this error:

Parse error: parse error in C:\xampp\htdocs\tiketku\cari.php on line 2

What am I doing wrong?

</div>

You have a space after <<<EOM. This is illegal. Remove the space and it will work fine.

From the manual:

A third way to delimit strings is the heredoc syntax: <<<. After this operator, an identifier is provided, then a newline.

You can't have whitespace between the identifier and the new line.

You have a space ␣ after the EOM.

<?
echo <<<EOM␣
Hello
EOM;
?>

You need to remove it.

You have an extra space character after the first "EOM"!