Need Some Help

Discussion in 'PHP' started by searchfordeal, Aug 18, 2006.

  1. #1
    I have site that display news,

    in mysql db, it stores html code then it displays like this
    <p><strong><sub><font size="3">By </font></sub></strong><a

    when you do display source from browser,

    &lt;p&gt;&lt;strong&gt;&lt;sub&gt;&lt;font size=&quot;3&quot;&gt;By &lt;/font&gt;


    any idea? why <p> fetched &lt;p&gt;?
     
    searchfordeal, Aug 18, 2006 IP
  2. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The tags are being converted. Before displaying, you may need to run the data returned from the MySQL database through html_entity_decode, as in

    $string = '&lt;p&gt;&lt;strong&gt;&lt;sub&gt;&lt;font size=&quot;3&quot;&gt;By &lt;/font&gt;';
    $string = html_entity_decode( $string);
    echo $string;
    Code (markup):
     
    clancey, Aug 18, 2006 IP
  3. searchfordeal

    searchfordeal Well-Known Member

    Messages:
    1,579
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    138
    #3
    yo da man..it worked..
     
    searchfordeal, Aug 18, 2006 IP