Advertisement
Guest User

Untitled

a guest
Feb 16th, 2015
185
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Inclusão do phpQuery
  2. if (!method_exists('phpQuery', 'newDocumentHTML'))
  3.  
  4. require_once 'phpQury/phpQuery-onefile.php';
  5.  
  6. //Inicialização do documento, substitua $body pela sua variável contendo o HTML;
  7. $doc = \phpQuery::newDocumentHTML($body, $charset = 'utf-8');
  8.  
  9. //Fazendo loop para capturar os dados
  10. $links = 0;
  11. foreach(\phpQuery::pq('ul#lista_municipios li')->find('a') as $linha) {
  12.  
  13. # $dados = [];
  14. echo $links++ . "<br>";
  15. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement