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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:37:01+00:00 2026-06-17T19:37:01+00:00

I want to get a table from other website (the table is being updated

  • 0

I want to get a table from other website (the table is being updated daily) and I want it to be shown in my website just not in the same arrangement as it has in the original website.

So I got the table using curl and strstr() but edit the whole table using string functions just seems pointless. I’m sure there is a much easier way doing this.

Maybe there is a way to create the original table in xml format that I’ll be able to play with the structure more easily?

Thank you very much!

  • 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-06-17T19:37:02+00:00Added an answer on June 17, 2026 at 7:37 pm

    Here’s a crude example of how you might consume the table (only to echo out another table), Below I’m using SimpleXML and xpath to search the document for the element that has a class of Table Data and looping through all the TR’s and putting some special conditions to deal with the and blocks that exist

    Obvious downside is if the third party website’s layout changes, your code will stop functioning.

    header('Content-Type: text/html; charset=UTF-8');
    $html = file_get_contents('http://www.votes-19.gov.il/nationalresults'); // or use curl
    $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"); 
    
    $doc = new DOMDocument();
    $doc->strictErrorChecking = FALSE;
    $doc->loadHTML($html);
    $xml = simplexml_import_dom($doc);
    
    echo '<!doctype html><html><head><style type="text/css">body{direction: rtl;}</style></head><body><table>';
    if($trxpath = $xml->xpath('//table[@class="TableData"]/tr'))
    {
      foreach($trxpath as $tr)
      {
        echo '<tr>';
        echo '<th>' . $tr->th . '</th>';
        foreach($tr->td as $td)
        {
          if($td->div)
            echo '<td>' . $td->div . '</td>';
          else
            echo '<td>' . $td . '</td>';
        }
        echo '</tr>';
      }
    }
    echo '</table></body></html>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I want to get all rows from the customers table that do NOT
I want to create a html page that get data from a website table
Using Access 2003 I want to get a table value from the two databases
I want to get data from table in MySQL and to show it in
I want to get data from a table in my MySQL database. $linkID =
I want to get all the records from the one table which contain at
I want to know how to get a specific row from a table in
I want to get the maximum id from a table. If I use mysqli_insert_id
I have 2 tables, table_a and table_b . I want to get user_id from
I want to get data from two tables. I have patient first name 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.