Results 1 to 3 of 3

Thread: htmlentities() not working as it supposed

  1. #1
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default htmlentities() not working as it supposed

    I've tried to execute the below mentioned PHP code (which is directly from PHP manual)
    PHP Code:
    <?php
    $str 
    "A 'quote' is <b>bold</b>";

    // Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
    echo htmlentities($str);

    // Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
    echo htmlentities($strENT_QUOTES);
    ?>
    But it didn't work as it supposed I mean I got the output like the following not like what they claim in the manual.

    Code:
    A 'quote' is <b>bold</b>A 'quote' is <b>bold</b>
    I am using PHP version 5.2.0

    I wonder why it is not working as it supposed.

    Can any please test and let me know about it?

    Thanks in advance

    regards

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    What page is it?
    What are you trying to do?
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    ok i think i've figured it out the functions works but when the browser renders it display its corresponding html characters rather than entity characters.

Bookmarks

Posting Permissions

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