39
44

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHP ヒアドキュメントの使いかた

Posted at

謎だった「EOM」は End Of Messageの略らしいです。

ABC など他の文字にしても大丈夫だそうです。

EOD (End Of Document)や
EOF (End Of File)という文字がよく使われるそうです。

これわかりやすかった
http://www.php-labo.net/tutorial/php/heredocument.html

heredocs

$dog = 'ぽち';

$heredocs = <<< EOM
<p>
	{$dog}は暑くても<br>
	今日も元気です 
</p>
EOM;

echo $heredocs;

/*
ぽちは暑くても
今日も元気です。
*/

39
44
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
39
44

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?