Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
古い「for Dummies」の本を読んでいて、ヒアドキュメントの出力に関するセクションに出くわしました。これは今でも(またはかつては)一般的なコーディング方法ですか?
print <<<HERE <table> <tr> <td> This is an example! </td> </tr> </table> HERE;
はい、使用されていますが、私は NOWDOC をより頻繁に使用する傾向があります。あなたの例とまったく同じように、インデントでフォーマットされた文字列を保持したい場合、それは本当に輝いています。必ずしも HTML だけでなく、連結の見苦しさを気にする必要のないフォーマットされた構文。