Error code: Parse error:syntax Error, unexpected $end in H:\wamp\www\testing\test\2.1.4.php on line 16
Error source code:
Copy Code code as follows:
<?php
$str = <<<eod
<br><font size= ' 2 ' > Test string </font>
<br><font size= ' 3 ' > Test string </font>
<br><font size= ' 4 ' > Test string </font>
EOD;
Echo $str;
Define the variables used for the delimiter
$name = ' Einstein ';
$dicta = "Imagination is more important than knowledge, because knowledge is limited, and imagination is infinite";
$size = 5;
Echo <<<eot
<br>
<font size= ' $size ' >said: ' {$dicta} ' </font>
EOT;
?>
Eclipse Error Picture
Error picture
This error is actually very simple, that is, at the end of the delimiter EOD and EOT, the Front tab, the solution is below write "EOD;" and "EOT;" I believe you beginners have the same experience as me ...
Correct code:
Copy Code code as follows:
<?php
$str = <<<eod
<br><font size= ' 2 ' > Test string </font>
<br><font size= ' 3 ' > Test string </font>
<br><font size= ' 4 ' > Test string </font>
EOD;
Echo $str;
Define the variables used for the delimiter
$name = ' Einstein ';
$dicta = "Imagination is more important than knowledge, because knowledge is limited, and imagination is infinite";
$size = 5;
Echo <<<eot
<br>
<font size= ' $size ' >said: ' {$dicta} ' </font>
EOT;
?>
Results screenshot: