0

Possible Duplicate:
How to display content of one site in another using PHP?

I need to display tide data on a website I am creating, I don't have any access to API's for such data so I was wondering if it is possible to take the table on this page: http://www.bom.gov.au/cgi-bin/oceanography/tides/tide_predications.cgi?location=SA_61900&tide_hiddenField=South%20Australia&years=2012&months=Oct&dates=16 and display it on my own page with the ability to reformat it so it looks pretty. Would it be possible to do this with PHP or Java?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Ben
  • 83
  • 4
  • 15

2 Answers2

0

You can use this php library SimpleHtml Dom

Follow the documentation it is pretty self explanatory

$html = file_get_html('http://www.bom.gov.au/cgi-b...');

foreach($html->find('table') as $table) {
   // your code here
}
Ibu
  • 42,752
  • 13
  • 76
  • 103
0
<?php function getHTML($url){ //inisialisation CURL

$data = curl_init();

// setting CURL

curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($data, CURLOPT_URL, $url);

// run CURL to read file

$value = curl_exec($data);

curl_close($data);

return $value;

}

?>

I hope it can help your problem..:)

fenz kurol
  • 113
  • 1
  • 10