Guest User

asdfxg435

a guest
Jul 3rd, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1. <?php
  2.  
  3. function parse_records($html) {
  4.     foreach($html->find('li.vcard') as $vcard):
  5.         $table = array();              
  6.         foreach($vcard->find('span.given-name') as $given_name):                   
  7.             $table['first_name'] = (trim(addslashes($given_name->plaintext), " "));
  8.         endforeach;
  9.         foreach($vcard->find('span.family-name') as $family_name):
  10.             $table['last_name'] = (trim(addslashes($family_name->plaintext)," "));
  11.         endforeach;
  12.         foreach($vcard->find('span.location') as $location):
  13.             $table['location'] = (trim(addslashes($location->plaintext), " "));
  14.         endforeach;
  15.         foreach($vcard->find('span.industry') as $industry):
  16.             $table['industry'] = (trim(addslashes($industry->plaintext), " "));
  17.         endforeach;
  18.         foreach($vcard->find('dd.current-content') as $headline):
  19.             $table['headline'] = (trim(addslashes($headline->plaintext), " "));
  20.         endforeach;
  21.         foreach($vcard->find('a.btn-primary') as $url):
  22.             $table['url'] = addslashes($url->href);
  23.         endforeach;
  24.     endforeach;
  25.     return $table = array();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment