Jump to content

use of Heredoc


dream25

Recommended Posts

1. You haven't explained what heredoc is so please dont expect anyone else to know
2. What did you try in IE7? what is the bug/error/problem?
3. If you want answers or help, help us to help you by providing enough information about the problem.

Plus the string you just placed up is incorrect as it is not surrounded in " quote marks.

As,

[code=php:0]
$my_string = "<<<TEST Tizag.com Webmaster Tutorials Unlock your potential! TEST";
[/code]
Link to comment
https://forums.phpfreaks.com/topic/35206-use-of-heredoc/#findComment-166241
Share on other sites

[quote]You haven't explained what heredoc is so please dont expect anyone else to know[/quote]

It is part of standard php. Read the manual on [url=http://php.net/echo]echo[/url] for more infomation.

[code]
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<?php
$my_string = <<<TEST
Tizag.com
Webmaster Tutorials
Unlock your potential!
TEST;
echo $my_string;
?>
</body>
</html>
[/code]

Should work. make sure the closing TEST is not indented.
Link to comment
https://forums.phpfreaks.com/topic/35206-use-of-heredoc/#findComment-166250
Share on other sites

[quote author=Cep link=topic=123485.msg510410#msg510410 date=1169466403]Plus the string you just placed up is incorrect as it is not surrounded in " quote marks.

As,

[code=php:0]
$my_string = "<<<TEST Tizag.com Webmaster Tutorials Unlock your potential! TEST";
[/code]

[/quote][quote author=Cep link=topic=123485.msg510415#msg510415 date=1169467176]
The reason for this is because HTML markup uses opening < and closing > brackets.

You could do one of two things add another < to your string OR you could escape each of them using "\<\<\<
[/quote]

Do not respond on that which you know not. When using the heredoc syntax you DO NOT enclose the content within quotes. Everything you posted above was completely false.
Link to comment
https://forums.phpfreaks.com/topic/35206-use-of-heredoc/#findComment-166487
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.