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

  • SEARCH
  • Home
  • 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 6907927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:29:47+00:00 2026-05-27T08:29:47+00:00

Hi there i have got my feed functioning problem I have is in the

  • 0

Hi there i have got my feed functioning problem I have is in the xml there is description tag and inside is html code. now php is treating the HTML tags as other xml tags and making more arrays. How can I stop this from creating arrays out of the HTML tags?
eg.

<description>
   <h3>Some text</h3>
</description>

its out putting

array['description'] => array['h3'] => "someText"

PHP code:

public function merchant_import_wahanda(){
        if (!$this->session->userdata('logged_in')){
            redirect('admin/login');
        }

        $data['pageTitle'] = 'Merchant Admin';
        $data['error_warning'] = '';
        $data['success'] = '';

        $xmlfile= 'http://www.wahanda.com/rss/mobdeal.xml';  
        $xmlRaw = file_get_contents($xmlfile);  

        $this->load->library('xml');  
        $xmlData = $this->xml->xml_parse($xmlRaw);
        $this->load->model('admin/Deals_model', 'Deals');
        $this->load->model('admin/Cities_model', 'Cities');
        $this->load->model('admin/Partners_model', 'Partners');

        //Get City ID
        foreach($xmlData["channel"]["item"] as $product){
            $cityName[] = $product['w:location']["@content"];
        }

        $cities = array_unique($cityName);
        foreach ($cities as $city){
            if(!$this->Cities->getCityByName($city)){
                $this->Cities->addFeedCity($city);
            }
        }

        //Get Partner ID
        foreach($xmlData["channel"]["item"] as $product){
            $partnerName[] = $product['w:venues']['w:venue']['w:name'];
        }

        $partners = array_unique($partnerName);
        foreach ($partners as $partner){
            if(!$this->Partners->getPartnerByName($partner)){
                $this->Partners->addFeedPartner($partner);
            }
        }

        foreach($xmlData["channel"]["item"] as $product){
            $cityID = $this->Cities->getCityByName($product['w:location']["@content"]);
            $partnerID = $this->Partners->getPartnerByName($product['w:venues']['w:venue']['w:name']);

            $deals[] = array(
                'dealTitle' => $product['title'],
                'price' => $product['w:price'],
                'image' => $product['w:hiResImageLink'],
                'buyLink' => $product['link'],
                'startDate' => $product['w:startDate'],
                'endDate' => $product['w:endDate'],
                'partner' => $partnerID['partner_id'],
                'city' => $cityID['city_id'],
                'description' => $product['description'],
                'RRP' => $product['w:rrp'],
                'discount' => $this->getDiscount($product['w:price'], $product['w:rrp'])
            );
        }
        ?><pre><?php var_dump($deals); ?></pre><?php
        foreach($deals as $deal){
            $this->Deals->importWahanda($deal);
        }
    }

XML Description example:

<description>
            <a id="Wahanda_loves" name="Wahanda_loves"></a><h3>Wahanda loves</h3>

<p>If you&#39;re fed up of shaving and can&#39;t bear the pain of waxing then remove hair the easy way with this course of IPL hair removal. It works by using beams of light to damage the hair follicle, meaning after a course of treatment you&#39;ll be hair-free for longer. Five sessions will catch the hair in each stage of the growth cycle so your skin will stay silky-smooth and fuzz-free for longer.</p>
<a id="What.27s_in_it_for_you.3F" name="What.27s_in_it_for_you.3F"></a><h3>What&#39;s in it for you?</h3>


<ul>
<li>Five IPL Sessions on <b>one</b> of the following areas:
<ul>
<li>Lip and Chin</li>
<li>Bikini Line</li>
<li>Underarm</li></ul></li></ul>


<ul>
<li>Location: <a href="/place/depicool-leeds/" title="place/depicool-leeds/">DepiCool</a>, Leeds</li>
<li>Available Monday - Saturday</li>
<li><b>Strict voucher limit of 1 per person.</b> May buy multiples as gifts</li>
<li>You will receive an eVoucher valid for one person to print out and take with you.</li>
<li>Voucher valid for 6 months</li>
<li>Cannot be used in conjunction with any other offer. Subject to availability. No cash alternative</li></ul>

<p>You&#39;ll get a snazzy pair of goggles to wear during the treatment so your eyes are protected throughout the fifteen minute procedure. DepiCool&#39;s therapists are fully qualified and consider your comfort and safety to be the most important part of the treatment process. All staff are trained to be able to answer your questions so you&#39;ll be informed at at ease at all times. </p>
<a id="Want_to_buy_this_as_a_gift.3F" name="Want_to_buy_this_as_a_gift.3F"></a><h3>Want to buy this as a gift?</h3>

<p>If you&#39;re feeling generous and want to buy this as a gift for someone, don&#39;t worry - the voucher won&#39;t show the price or discount of the MobDeal if you add a gift message, making it perfect for giving as a gift. All you need to do is choose how many vouchers you&#39;d like to buy at checkout so you can enter each recipient&#39;s name on the coupon, then add your message for the lucky recipient.</p></description>
  • 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-27T08:29:48+00:00Added an answer on May 27, 2026 at 8:29 am

    You can either place your HTML into CDATA, as suggested by Agop, or encode the characters – use < instead of <, > instead of >, etc. As far as XML is concerned, they are identical. I’d go for the CDATA option since you have many lines of HTML, and it’s more readable.

    <description>
        <![CDATA[<a id="Wahanda_loves" name="Wahanda_loves"></a><h3>Wahanda loves</h3>
    
        <p>If you&#39;re fed up of shaving and can&#39;t bear the pain of waxing then remove hair the easy way with this course of IPL hair removal. It works by using beams of light to damage the hair follicle, meaning after a course of treatment you&#39;ll be hair-free for longer. Five sessions will catch the hair in each stage of the growth cycle so your skin will stay silky-smooth and fuzz-free for longer.</p>
        <a id="What.27s_in_it_for_you.3F" name="What.27s_in_it_for_you.3F"></a><h3>What&#39;s in it for you?</h3>
    
        ...
    
        ]]>
    </description>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have got a custom MembershipProvider in ASP.NET . Now there are 2 possible
There have been a few occasions in which I've got some code in some
Have got an NSString *str = @12345.6789 and want to find out if there
I've got main folder: c:\test And there I have 2 folders: Movies and Photos.
So I've got some data. There are entities. Entities have an arbitrary number of
I have got a program which checks if there's a version update on the
In Unix, I have got three main files. One of them is a library
I'm using Google Test Framework to set some unit tests. I have got three
I have got an UITableView. How to simply fill it with three elements, for
I have got as follows: use constant ABC => ('one', 'two', 'three'); and I

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.