Jump to content

[Question] Retrieving Data from other websites.


xplosive

Recommended Posts

Is it possible to make a PHP script, that retrieves date from another website, and displays on your website.

 

Perhaps an example would be football scores?

 

Say if I wanted to read certain data on BBC Sport Page, and echo/ print it on my website?

 

If so, how would I go about doing this?

 

Thanks!

Can you give me an example?

Not sure how it all works.

 

libxml_use_internal_errors(true);

$dom = new DomDocument();
if ($dom->loadHtmlFile('http://../file.html')) {
  $xpath = new DomXPath($dom);
  foreach ($xpath->query('//td[@score]') as $node) {
    print $node->nodeValue . "<br />\n";
  }
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.