Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function parse_records($html) {
- foreach($html->find('li.vcard') as $vcard):
- $table = array();
- foreach($vcard->find('span.given-name') as $given_name):
- $table['first_name'] = (trim(addslashes($given_name->plaintext), " "));
- endforeach;
- foreach($vcard->find('span.family-name') as $family_name):
- $table['last_name'] = (trim(addslashes($family_name->plaintext)," "));
- endforeach;
- foreach($vcard->find('span.location') as $location):
- $table['location'] = (trim(addslashes($location->plaintext), " "));
- endforeach;
- foreach($vcard->find('span.industry') as $industry):
- $table['industry'] = (trim(addslashes($industry->plaintext), " "));
- endforeach;
- foreach($vcard->find('dd.current-content') as $headline):
- $table['headline'] = (trim(addslashes($headline->plaintext), " "));
- endforeach;
- foreach($vcard->find('a.btn-primary') as $url):
- $table['url'] = addslashes($url->href);
- endforeach;
- endforeach;
- return $table = array();
- }
Advertisement
Add Comment
Please, Sign In to add comment