Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> CURL Pobieranie tekstu z curla
Invrality
post
Post #1





Grupa: Zarejestrowani
Postów: 40
Pomógł: 0
Dołączył: 9.06.2013

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


WWWitam!


Chcę pobrać sobie adres url obrazka, ze strony.

Mam CURLA, no i taką funkcję:


  1. preg_match_all('/img id=(.*) onmousedown=(.*) src=(.*)/', $result, $a);


No i wyświetla to źle.

  1. img id="ctl00_CPHBody_LVImages_ctrl5_ImgPhoto" onmousedown="event.preventDefault ? event.preventDefault() : event.returnValue = false" src="Gallery/arni/20130531_131404/nice.jpg" />
  2.  
  3. "ctl00_CPHBody_LVImages_ctrl5_ImgPhoto" "event.preventDefault ? event.preventDefault() : event.returnValue = false" "Gallery/arni/20130531_131404/nice.jpg" />

1 kod mi wyświetla z img id, a drugi bez tego img id, no właśnie, dlaczego dwa? no i całkiem inaczej to wyświetla.

I 2 pytanie, mam tutaj id, onmousedown, ale chcę to pominąć, zostawić samo src, jak tego dokonać w tym preg.?


A funkcja wyświetlania:

  1. foreach ($a as $ml) {
  2. echo $ml[5]."\n";
  3. }


Ten post edytował Invrality 12.06.2013, 15:06:38
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: 24.08.2025 - 22:41