1. <?php
  2. //nowdoc(单引号定界符)
  3. //ABC可以是任合内容,放在单引号中
  4. $c=<<<'ABC'
  5. 这里可以是任合内容
  6. 我是历的苛夺基
  7. 本原则叶落归根在运
  8. 输费艰难田¥¥&……
  9. ABC;
  10. echo $c;
  11. ?>
  12. <?php
  13. //heredoc(双引号定界符)
  14. //ABC可以是任合内容,放在双引号中或是不加引号
  15. $c=<<<ABC
  16. 这里可以是任合内容
  17. 我是历的苛夺基
  18. 本原则叶落归根在运
  19. 输费艰难田¥¥&……
  20. ABC;
  21. echo $c;
  22. ?>


  1. <<<Eof
  2. ……
  3. Eof;

Parse error: parse error, unexpected $end in……,提示你语法错误;

  1. <<<Eof
  2. hello{$name}
  3. Eof;


  1. <<<Eof
  2. hello<?php echo $name?>
  3. Eof;


  1. <?php
  2. $name = 'kitty';
  3. echo <<<Eof
  4. <table height="20">
  5. <tr><td>
  6. {$name}<br/>
  7. <script>
  8. var p='hello world';
  9. document.writeln(p);
  10. </script>>
  11. </td></tr>
  12. </table>
  13. Eof;
  14. ?>
点赞 ( 0 )

9 条评论

  1. how to find cheap flights

    This is a topic which is close to my heart... Thank you! Exactly where are your contact details though?

  2. best way to book flights

    I delight in, lead to I discovered exactly what I used to be looking for. You've ended my four day long hunt! God Bless you man. Have a nice day. Bye

  3. cheap airline ticket

    Hey! Would you mind if I share your blog with my twitter group? There's a lot of people that I think would really appreciate your content. Please let me know. Cheers

  4. flight ticket booking

    This article will assist the internet people for setting up new weblog or even a weblog from start to end.

  5. super cheap flights

    Hi there! I just would like to give you a big thumbs up for your great info you have here on this post. I'll be returning to your website for more soon.

  6. extremely low airfares

    I'm truly enjoying the design and layout of your site. It's a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a developer to create your theme? Outstanding work!

  7. Randy

    Hey very interesting blog!

  8. find cheap flights

    After going over a number of the articles on your blog, I seriously appreciate your technique of blogging. I book-marked it to my bookmark website list and will be checking back soon. Please visit my web site as well and tell me your opinion.

  9. gamefly

    Hey There. I discovered your weblog the use of msn. That is a very neatly written article. I'll be sure to bookmark it and come back to read extra of your useful info. Thank you for the post. I'll certainly return.