xml

Rob Loach's picture

getDOM

  1. function getDOM($url) {
  2.         $ch = curl_init ();
  3.         curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  4.         curl_setopt ($ch, CURLOPT_URL, $url);
  5.         curl_setopt ($ch, CURLOPT_TIMEOUT, 10);

scrape it up

  1.  $xml = simple_get_xml('http://www.cotrip.org/atis/web.TraveltimeMarshal');
  2.   $table = $xml->xpath('/html/body/table[3]');
  3.   foreach ($table[0]->tr as $item) {
  4.     if (count($item) == 1) {
Syndicate content