Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> preg_match_all wyciągnięcie znacznika <a>(.*?)</a>
Randallmaster
post
Post #1





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

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


  1. <?php
  2.  
  3. $curl = curl_init();
  4. curl_setopt($curl, CURLOPT_URL, "http://www.infopraca.pl/praca/1/wielkopolskie/kalisz");
  5. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  6.  
  7. $result = curl_exec($curl);
  8. curl_close($curl);
  9.  
  10. //links
  11.  
  12.  
  13. if (preg_match_all("#<p class=\"job-title\">(.*?)</p>#", $result, $links))
  14. {
  15. foreach ($links[0] as $link)
  16. {
  17. if (preg_match_all("#<a href=\"(*)\">(.*?)</a>#", $result, $links))
  18. {
  19. foreach ($links[1] as $link)
  20. {
  21. echo $link."<br>";
  22. }
  23. }
  24. }
  25.  
  26. }
  27.  
  28. ?>


Mam taki kod i w miejscu gdzie jest <a href chce mieć tylko wywołane to co jest pogrubione... Jak to zrobić? Siedzę już 2h nad tym sad.gif
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 21.08.2025 - 11:21