Pogledajte određenu poruku
Staro 22. 08. 2011.   #2
webarto
expert
Grand Master
 
Avatar webarto
 
Datum učlanjenja: 11.04.2010
Poruke: 998
Hvala: 141
959 "Hvala" u 153 poruka
webarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished road
Default

Probaj...

http://codepad.org/0zlzTmUH

PHP kôd:
<?php

$html 
'<head>
<meta name="description" content="Free Web tutorials" />
<meta name="keywords" content="HTML,CSS,XML,JavaScript" />
<meta name="author" content="Hege Refsnes" />
<meta http-equiv="refresh" content="0; url=http://example.com/">
</head>'
;

$html strtolower($html);

$dom = new DOMDocument();
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$e $xpath->query("//meta[@http-equiv='refresh']/@content");

$content $e->item(0)->textContent;
$content explode('='$content);
$url trim($content[1]);

echo 
$url;

?>
__________________
Github // LinkedIn // PHP // ZCE // Stackoverflow PHP // Site5 Web Hosting
webarto je offline   Odgovorite uz citat
"Hvala" webarto za poruku: