Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $link = curl_init();
- curl_setopt($link, CURLOPT_URL, "http://pid.idos.cz/odjezdy/?f=Malvazinky&t=Na+Kn%C3%AD%C5%BEec%C3%AD&tc=301003&fc=301003&submit=true");
- curl_setopt($link, CURLOPT_HEADER, 0);
- curl_setopt($link, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.16 Safari/537.36");
- curl_setopt($link, CURLOPT_RETURNTRANSFER, true);
- $result = curl_exec($link);
- echo '<pre>';
- $result = substr($result,(strpos($result, "<table class=\"results\" border=\"0\">")));
- $result = substr($result, 0, -strlen($result)+strpos($result, "</table>")+8);
- //echo htmlspecialchars($result);
- $result = str_replace(" ", "", $result);
- //echo htmlspecialchars($result);
- $xml = simplexml_load_string($result);
- //var_dump($xml);
- //echo $xml->tbody->tr[0]->td[0];
- foreach ($xml->tbody->tr as $item)
- echo $item->td[0]."<br>";
- echo '</pre>';
Advertisement
Add Comment
Please, Sign In to add comment