Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][cURL]preg_match_all i google
NeRoK
post
Post #1





Grupa: Zarejestrowani
Postów: 28
Pomógł: 0
Dołączył: 29.04.2006

Ostrzeżenie: (0%)
-----


Witam,

Mam taki kod:
  1. <?php
  2. $ch = curl_init();
  3. curl_setopt($ch, CURLOPT_HEADER, false);
  4. curl_setopt($ch, CURLOPT_HTTPGET, true);
  5. curl_setopt($ch, CURLOPT_POST, false);
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  7.  
  8. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1");
  9. $strona = curl_exec($ch);
  10. curl_close($ch);
  11.  
  12. preg_match_all('@<h3 class=r><a href="(.*)" class=l>(.*)</a></h3>(.*)<div class="s">(.*)<br><cite>@iU', $strona, $wynik);
  13. print_r($wynik);
  14. ?>


Niestety w tablicy nie mam żadnych wyników... Podejrzewam, że "coś jest źle" z wyrażeniem regularnym. Jak mogę poprawić to wyrażenie, żeby działało jak należy?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.08.2025 - 08:11