Cita:
Iniciado por andresdzphp
Podrías usar las clases [URL="http://php.net/manual/es/book.dom.php"]DOM[/URL] de PHP:
Código PHP:
Ver original<?php
$doc = new DOMDocument();
$data = $doc->getElementsByTagName('tt');
echo $data->item(1)->nodeValue;
//LEMD SID PINAR UN870 PONEN UT600 CASPE STAR LEBL
Lo he puestoa así pero no funciona:
Código PHP:
Ver original<?php
$url = "http://rfinder.asalink.net/free/autoroute_rtx.php";
$id1 = "LEMD";
$ic1 = "";
$id2 = "LEBL";
$ic2 = "";
$minalt = "FL330";
$maxalt = "FL330";
$lvl = "B";
$dbid = "1213";
$usesid = "Y";
$usestar = "Y";
$rnav = "Y";
$nats = "";
$k= "1191228562";
curl_setopt ($sesion, CURLOPT_POSTFIELDS
, $parametros_post);
$doc = new DOMDocument();
$data = $doc->getElementsByTagName('tt');
echo $data->item(1)->nodeValue;
//LEMD SID PINAR UN870 PONEN UT600 CASPE STAR LEBL
?>
Da este error:
Cita: Warning: file_get_contents( <html> <head> <style> body { font-family: verdana; font-size: 12 } table { font-family: verdana; font-size: 12; border-collapse:collapse } td { font-family: verdana; font-size: 12; border:solid black 0.1pt; padding:3pt } </style> <title>RouteFinder - LEMD - LEBL - Not for real world navigation</title> </head> <body> <font size=+1 color=#0000FF><a href=./><b>RouteFinder</b></a></font><br><i>Route generator for PC flight simulation use - <b>NOT FOR REAL WORLD NAVIGATION</b></i><br> (C)2005-2007 ASA srl - Italy <hr> Computed route from <b>MADRID/BARAJAS</b> (LEMD, LE) to <b>BARCELONA/EL PRAT</b> (LEBL, LE): 8 fixes, 267.6 nautical miles<br><br><tt>Cruise altitude between FL330 and FL330<br> <b>LEMD</b> (0.0nm) -SID-> <b>PINAR</b> (53.3nm) -UN870-> <b>SEGRE</b> (63.7 in C:\xampp\htdocs\airvirtus\albrep\rfinder.php on line 36
Warning: DOMDocument::loadHTML(): Empty string supplied as input in C:\xampp\htdocs\airvirtus\albrep\rfinder.php on line 36
Notice: Trying to get property of non-object in C:\xampp\htdocs\airvirtus\albrep\rfinder.php on line 38