PHP echo inside echo

前端 未结 4 1638
攒了一身酷
攒了一身酷 2020-12-02 02:43

I\'m trying to call an HTML/PHP content that it\'s inside my database using:


When the row i

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 03:32

    Don't do this. Multi-line echoes, especially when you've got embedded quotes, quickly become a pain. Use a HEREDOC instead.

    Hello
    ...
    
    ... EOL;

    and yes, the PHP inside your echo will NOT execute. PHP is not a "recursively executable" language. If you're outputting a string, any php code embedded in that string is not executed - it'll be treated as part of the output, e.g.

    echo ""
    

    is NOT going to output just foo. You'll actually get as output

    
    

提交回复
热议问题