Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6833105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:56:19+00:00 2026-05-26T22:56:19+00:00

Sorry if this has been asked before – there’s a question with a similar

  • 0

Sorry if this has been asked before – there’s a question with a similar title but it’s not quite what I’m looking for.

What I am doing is fetching results from a DB and printing them out inside the appropriate tags to create an RSS Feed.

The only problem is the body of the article contains html tags so my rss feed doesn’t load correctly.

So far I have tried:

$rssfeed .= '<description>' . htmlentities($row['text') . '</description>';

and

$rssfeed .= '<description>' . htmlspecialchars($row['text'], ENT_COMPAT, 'UTF-8') . '</description>';

Using either of those just gives me a completely blank feed.

I actually just tried this aswell and got the same result:

$rssfeed .= '<description>' . $row['text']. '</description>';

I’m more confused now as surely that should have worked? The only thing I can think of is that the row in the database is too long for the RSS Feed as it’s a full article worth of text and HTML in there.

I wasn’t sure if it would automatically be truncated or not.

Any ideas?

UPDATE

This is some sample output:

<?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0">
        <channel>
            <title>RSS feed</title>
            <link>http://www.12345.co.uk</link>
            <description>RSS Feed from 12345.co.uk</description>
            <language>en-uk</language>
            <copyright>Copyright (C) 2011 12345.co.uk</copyright>
            <item>
                <title>Wear safe but stylish sunglasses on the slopes</title>
                <description><![CDATA["<p>Holidaymakers hitting the slopes this year must remember to pack a pair of sunglasses alongside their skis, one expert has highlighted.</p>
                <p>Dharmesh Patel, chairman of the Eyecare Trust, noted that UV protective eyewear is a must for skiers.</p>
                <p>Posted by xxxxx</p>v"]]>
                </description>
                <link></link>
                <pubDate>Mon, 03 Oct 2011 16:57:09 +0000</pubDate>
            </item>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:56:20+00:00Added an answer on May 26, 2026 at 10:56 pm

    Since RSS is an XML-Language, you’ll want to use an CDATA section:

    <description><![CDATA["<b>Use tags here</b>"]]></description>
    

    In PHP, you can easily archive this (with the XMLWriter) by using the startCData() and endCData()-methods.

    If the XML-Reader displays your HTML correctly depends on the parser it’s using. Using escape-sequences is however valid XML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sorry if this question has been asked before, but I'm not even sure
sorry if this question has been asked before, I searched but wasn't sure on
Sorry I know this question has probably been asked before, but do you know
So, if this question has been asked before, I'm sorry. I'm not exactly sure
I'm sorry if this question has been asked before, but I can't seem to
Sorry if this has been asked before or it's a really dumb question, but
Sorry if this has been asked before, but I'm wondering what the best memory
I'm sorry if this question has been asked already, but I couldn't find it
Sorry if this has been asked before, I did check but couldn't find anything...
I'm sorry if this has been asked before, but I'm in kind of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.