Error code: Parse error: syntax error, unexpected $end in H:wampwwwtestingtest2.1.4.php on line 16
Error source code:
Copy code The code is as follows:
$str = <<
test string< ;/font>
Test string
Test string< ;/font>
EOD;
echo $str;
//Variables used to define delimiters
$name = 'Einstein';
$dicta = "Imagination More important than knowledge, because knowledge is limited, but imagination is unlimited";
$size = 5;
echo <<
< font size='$size'>said:"{$dicta}"
EOT;
?>
Eclipse error picture
Error picture
This error is actually very simple, that is, at the end of the delimiters EOD and EOT, a Tab is added in front. The solution is to write "EOD;" and "EOT;" in the top box. I believe all beginners have the same experience as me...
Correct code:
Copy code The code is as follows:
$str = <<
test string
Test string
Test string
EOD;
echo $str;
//Variables used for delimiter definition
$name = 'Einstein';
$dicta = "Imagination is more important than knowledge, because knowledge is limited, And imagination is unlimited";
$size = 5;
echo <<
said: "{$dicta}"
EOT;
?>
Result screenshot:
http://www.bkjia.com/PHPjc/323494.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323494.htmlTechArticleError code: Parse error: syntax error, unexpected $end in H:wampwwwtestingtest2.1.4.php on line 16 Error Source code: Copy the code as follows: ?php $str = EOD brfont size=...