Advertisement
Guest User

Untitled

a guest
Jan 5th, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.90 KB | None | 0 0
  1. <?php
  2.  
  3. $url = "http://www.pslib.cz/files/rozvrhy/trzn.htm";
  4. $str = file_get_contents($url);
  5. strip_tags($str, "<tr></tr><td></td><table></table><br>");
  6.  
  7. $pieces = explode("<tr>", $str);
  8. $out = ("<html>
  9. <head>
  10. <meta http-equiv=\"Content-Language\" content=\"cs\">
  11. <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1250\">
  12. <meta http-equiv=\"Pragma\" content=\"no-cache\">
  13. <title>Bakaláři - Rozvrh hodin</title>
  14. <link rel=\"stylesheet\" type=\"text/css\" href=\"styly_r.css\">
  15. </head>
  16. <body class=\"rozvrh_1\">
  17.  
  18. <table class=\"tb_rozvrh_1\" width=\"100%\">
  19.  <tr>
  20.    <td class = \"td_ohr_1\" width=\"1%\" height=\"5px\"></td>
  21.    <td class = \"td_ohr_1\" width=\"3%\" height=\"5px\"></td>
  22.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  23.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  24.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  25.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  26.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  27.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  28.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  29.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  30.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  31.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  32.    <td class = \"td_ohr_1\" width=\"8%\" height=\"5px\"></td>
  33.    <td class = \"td_ohr_1\" width=\"1%\" height=\"5px\"></td>
  34.  </tr><tr>");
  35.  
  36. for ($i = 1; $i < sizeof($pieces); $i++) {
  37.     if (strpos($pieces[$i], 'Č<br>t') !== false) {
  38.         $out .= $pieces[$i];
  39.         for ($x=$i+1;$x<sizeof($pieces);$x++){
  40.             if (strpos($pieces[$x], '3%') !== false) {
  41.                  break;
  42.             }
  43.             else
  44.             {
  45.                 $out .= $pieces[$x];
  46.             }
  47.         }
  48.     }
  49. }
  50. $out .= "<tr></body>
  51. </html>
  52. ";
  53. echo $out;
  54.  
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement