Jump to content

Complete beginner help.


rjanak

Recommended Posts

Just started a book today on PHP and I have no other programming knowledge. I'm stuck on a very early example in the book though. Unless I'm reading it wrong, they say <<<_END..._END; should interpret everything inside it literally. So I'm not understanding why when I run the following example, the text is not put on new lines.

<?php
$author = "rjanak";

echo <<<_END
This is a Headline

This is the first line.
This is the second.
- Written by $author.
_END;
?>

 

From what I think the book is saying is that it should appear as follows...

This is a Headline

 

This is the first line.

This is the second.

- Written by rjanak.

... but it is appearing like this...

This is a Headline This is the first line. This is the second. - Written by rjanak.

 

Thanks in advance for the help... I don't want to continue until I understand it!

 

(Using OS X, MAMP, NetBean. All latest versions.)

Link to comment
https://forums.phpfreaks.com/topic/200341-complete-beginner-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.