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?
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?
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.