Advertisement
Tutorialist

php Help

Aug 8th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <?php
  2.  
  3. $homepage = file_get_contents('http://hessenschau.de/osthessen/index.html');
  4.  
  5. $StringSplitt = explode ("article", $homepage);
  6.  
  7. #echo '<pre>';
  8. #print_r($StringSplitt);
  9. #echo '</pre>';
  10.  
  11.  
  12. for ($i = 0;
  13.     $i <= count($StringSplitt); $i++) {
  14.    
  15.  
  16.      $temp = $StringSplitt[$i];
  17.      $temp= explode("<h3>", $temp);
  18.      $temp = explode('</h3>', $temp[1]);
  19.        
  20.      
  21.    # echo ($temp[0])."<br />";
  22.    $head = str_replace('zum Artikel ', '', $temp[0]);
  23.     $head = explode ("", )
  24.    
  25.    
  26.      echo $i." " . $head;
  27.      echo "<br /";
  28.      
  29.    
  30.  
  31. }
  32.  
  33. ?>
  34.  
  35. localhost:
  36.  
  37. 0
  38. Zwischen Handwerk und Sterne-Gastronomie : Deutscher Grillmeister in Fulda gekrönt
  39. Nach Überholvorgang : Motorradfahrer bei Unfall getötet
  40. Diebstahl auf Parkplatz : Planenschlitzer erbeuten Kaffeemaschinen und Bügeleisen
  41.  
  42. Ich möchte alles vor dem : löschen.
  43. Danke
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement