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 620775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:48:03+00:00 2026-05-13T18:48:03+00:00

my first time here. I got these lines as a response from the server

  • 0

my first time here.
I got these lines as a response from the server and saved them in a file. They look like XML, right? My task is to read the content of those td tags and put them into other structured file(Excel). The problem is I dont know how to do that.

At the moment, I think I will strip the first and last line of the file then parse them into XML. But do you know other ways ? Thanks.

<CallbackContent><![CDATA[
    <table cellspacing="0" border="0" cellpadding="0" width="100%">
        <tr class="rowcolor2">
            <td align="left" style="padding:5px;">22/02/2010</td>                        
            <td align="right" style="padding:5px;">510,02</td>
        </tr>
    </table>     
]]></CallbackContent>

Btw, I’m using PHP.

  • 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-13T18:48:03+00:00Added an answer on May 13, 2026 at 6:48 pm

    Use an XML parser such as SimpleXML. It will allow you to extract the CDATA safely.

    Then if the HTML is XML-compliant (in other words, it’s XHTML) you can use SimpleXML to extract data from it. For example:

    $xml='<CallbackContent><![CDATA[
        <table cellspacing="0" border="0" cellpadding="0" width="100%">
            <tr class="rowcolor2">
                <td align="left" style="padding:5px;">22/02/2010</td>                        
                <td align="right" style="padding:5px;">510,02</td>
            </tr>
        </table>     
    ]]></CallbackContent>';
    
    $CallbackContent = simplexml_load_string($xml);
    $html = (string) $CallbackContent;
    
    // if XHTML
    $table = simplexml_load_string($html);
    
    // otherwise, use
    $dom = new DOMDocument;
    $dom->loadHTML($html);
    $table = simplexml_import_dom($dom)->body->table;
    
    foreach ($table->tr as $tr)
    {
        echo 'tr class=', $tr['class'], "\n";
        foreach ($tr->td as $td)
        {
            echo 'td align=', $td['align'], ' - value: ', (string) $td, "\n";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem here im trying to upload a file first time it
This is my first time here and I am a beginner so kindly bear
This is my first time here so I hope I post this question at
first time post here. I was hoping someone could help me make custom SPARQL
first time posting here so be gentle :) On my web pages I have
first time posting here. I'm using a loop to create 3 buttons, but my
First time poster here. A quick question about setting up a loop here. I
this is my first time posting here, I have a question which I have
this is my first time asking a question here. I tried to be well
So here I am, first time windows developer (done java swing, iphone, flash/flex) and

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.