Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][cURL] preg_match
Trecco
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 11.08.2009

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


Witam, mam mały problem ze skryptem, niby wszystko śmiga, ale pokazuje mi się ten błąd:
  1. Warning: preg_match() expects at least 2 parameters, 1 given in /home/trecco/public_html/test.php on line 9

na początku lini, na dole pokazuje wszystko tak jak ma być, oto kod:

  1. <?php
  2. $qwe = '/<html>(.+?)</html>/';
  3. $curl = curl_init();
  4. curl_setopt($curl, CURLOPT_HEADER, 0);
  5. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  6. curl_setopt($curl, CURLOPT_VERBOSE, 1);
  7. curl_setopt($curl, CURLOPT_REFERER, 'http://strona.pl');
  8. curl_setopt($curl, CURLOPT_URL, 'http://strona.pl/sb.htm');
  9. preg_match($qwe);
  10. $google = curl_exec($curl);
  11. print_r($google);
  12. curl_close($curl);
  13. ?>


I jeszcze jedno, jak ściągnąć do pokazanego wyniku kod css?

Ten post edytował Trecco 25.02.2010, 02:27:57
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Trecco
post
Post #2





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 11.08.2009

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


no ale jak ten xpatch użyć na pliku zewnętrznym? szukałem mniej więcej, ale znalazłem same funkcje z przykładami xml, napisałem coś takiego:
  1. <?php
  2. load('http://www.gametracker.com/server_info/193.33.177.15:27106/');
  3.  
  4. $xpath = new DOMXPath($doc);
  5. $arts = $xpath->query("/html/body/div[6]/div[4]/div[5]/div/table");
  6.  
  7. foreach ($arts as $art)
  8. {
  9. echo $art->nodeValue."";
  10. }
  11. ?>


ale mi wywala
  1. Fatal error: Call to undefined function load() in /home/bgtest/domains/1245896/public_html/test3.php on line 2


Ten post edytował Trecco 26.02.2010, 16:02:25
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: 6.10.2025 - 20:46