Issue with heredoc and PHP

后端 未结 2 1230
再見小時候
再見小時候 2021-01-27 06:58

I am following The book \"Beginning PHP, Apache, MySQL web development\" by Wrox. I have been following it verbatim and for some reason I am having a issue with the code. The ed

相关标签:
2条回答
  • 2021-01-27 07:27

    Closing heredoc statement must be at the very first position in the string:

    ENDHTML;    // works
      ENDHTML;  // won’t work
    
    0 讨论(0)
  • 2021-01-27 07:36

    When you end an heredoc you must not put any char at the begining of the line. In your code there are heredocs with spaces or tabs before them. Delete the spaces and put your heredoc at the begining of the line.

    • More info on heredoc.
    0 讨论(0)
提交回复
热议问题