[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:
Ich möchte allerdings nur was hinter "Location: " steht. Dann habe ich folgendes versucht:
1. preg_match
Ergebnis: Leere Ausgabe
2. explode
Ausgabe:
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...
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
1. preg_match
PHP:
$regex = '#Location: (.*?)\n#';
preg_match ($regex, $info['redirect_time'], $location);
2. explode
PHP:
$location = explode('Location: ', $location);
print_r($location);
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: