www.webdeveloper.com
Results 1 to 4 of 4

Thread: Echo html without parsing it.

  1. #1
    Join Date
    Jun 2008
    Posts
    207

    Echo html without parsing it.

    Hi, I want to be able to echo content that contains variables holding HTML. The problem is I don't want the html to be parsed.

    Can anyone help me.

    Thanks in advance.

  2. #2
    Join Date
    Nov 2008
    Posts
    157
    PHP Code:
    $str "<html><body>Junk</body></html>";
    echo 
    htmlspecialchars($str); 

  3. #3
    Join Date
    Oct 2007
    Location
    Sweden
    Posts
    225
    $str = "<pre><html><body>Junk</body></html></pre>";
    echo $str;

    Both should work, but I would still recommend using mintedjo's version.

  4. #4
    Join Date
    Jun 2008
    Posts
    207
    Grand. Thanks guys ;-)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles