Tuesday, November 6, 2018

Parse error: syntax error, unexpected T_SL PHP heredoc



I keep getting the following error:




Parse error: syntax error, unexpected T_SL in /home/a4999406/public_html/willingLog.html on line 70




on the following code (first line is line 70):




        echo <<

First
Last
Email
Username


END;



heredoc just doesn't seem to work. i've tried other examples.



following is by doctype heading. is there something wrong there?



"http://www.w3.org/TR/html4/strict.dtd">

Answer




Looking at the copy-paste, it looks like you have a space character after the word "END" on the first line:



'echo <<


Try getting rid of the space character. Answer found by Googling. Source (link now dead): http://www.alexxoid.com/blog/dev/php-dev/php-parse-error-unexpected-t_sl.html


No comments:

Post a Comment

plot explanation - Why did Peaches&#39; mom hang on the tree? - Movies &amp; TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...