Advertisement
joris

Simple HTML Parser

Aug 14th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <?php
  2. include "simple_html_dom.php";
  3.  
  4. $html = file_get_html('http://berthojoris.com/data/curl/21cineplex/now_playing_1.php');
  5.  
  6.  
  7. // Extract Data
  8.         $i = 0;
  9.     foreach($html->find('li') as $element){
  10.        
  11.         $img = $html->find('img[title]',$i);
  12.         echo $img->attr['title'];
  13.         echo "<br>";
  14.         $link = $html->find('a[href]',$i);
  15.         echo $link->attr['href'];
  16.         echo "<br>";
  17.         $img = $html->find('img[src]',$i);
  18.         echo $img->attr['src'];
  19.         echo "<br>";
  20.         echo $html->find("p", $i);
  21.         echo "<br>";
  22.     $i++;
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement