• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

CUrl-Problem: redirect_time

Status
Für weitere Antworten geschlossen.

marlin-b

Neues Mitglied
[Gelöst] CUrl-Problem: redirect_time

Hallo!
und hier kommt schon das zweite Problem. Ich rufe eine Webseite mit Curl auf, und rufe dann Informationen zur Übertragung ab.
$info = curl_getinfo($d);
Die für mich wichtigen Informationen stehen in
$info['redirect_time']
Wenn ich diese Ausgebe kommt:
Code:
0HTTP/1.1 301 Moved permanently 
Content-Length: 0 
Date: Tue, 01 Jul 2008 18:29:16 GMT 
Connection: close 
Location: http://google78.go.funpic.de/down.htm 
Content-Type: text/html
Ich möchte allerdings nur was hinter "Location: " steht. Dann habe ich folgendes versucht:
1. preg_match
PHP:
$regex  = '#Location: (.*?)\n#'; 
preg_match ($regex, $info['redirect_time'], $location);
Ergebnis: Leere Ausgabe
2. explode
PHP:
$location = explode('Location: ', $location);
print_r($location);
Ausgabe:
Code:
Array ( [0] =>0HTTP/1.1 301 Moved permanently 
Content-Length: 0 
Date: Tue, 01 Jul 2008 18:29:16 GMT 
Connection: close 
Location: http://google78.go.funpic.de/down.htm 
Content-Type: text/html
)

Weiß jemand wieso des nicht geht?


Marlin

Lösung: Kleine Pause machen und logisch denken, dann bemerkt man, dass alles Bullshit ist, was ich geschrieben habe...
 
Zuletzt bearbeitet:
Status
Für weitere Antworten geschlossen.
Zurück
Oben