I used the tags in the table to give a way to output, example replacing <td class="label">
with Label :
and so on. But these td class="value"
are all cluttered, have <td class="value">
and <td class="value" >
etc
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<?php
$myLine = "";
if(!($myFile=fopen("http://metadados.capes.gov.br/index.php/catalog/100","r"
)))
{
echo "Arquivo não-acessÃvel";
exit;
}
while(!feof($myFile))
{
$myLine .= fgets($myFile,255);
}
fclose($myFile);
$start = '<table class="grid-table survey-info" cellspacing="0">'; //ponto inicial da procura no código fonte da pg
$end = "</table>"; //ponto final da procura no código fonte da pg
$start_position=strpos($myLine, $start);
$end_position=strpos($myLine, $end)+strlen($end);
$length = $end_position - $start_position;
$myLine = substr($myLine, $start_position, $length);
$myLine = str_replace('<table class="grid-table survey-info" cellspacing="0">',"",$myLine);
$myLine = str_replace('</table>',"",$myLine);
$myLine = str_replace('<tr>',"",$myLine);
$myLine = str_replace('</tr>',"<br>",$myLine);
$myLine = str_replace('<tr valign="top" >',"",$myLine);
$myLine = str_replace('<tr itemprop="spatial" itemscope="itemscope" itemtype="http://schema.org/Country">',"",$myLine);
$myLine = str_replace('<tr valign="top" itemprop="producer" itemscope="itemscope" itemtype="http://schema.org/Person">',"",$myLine);
$myLine = str_replace('<td class="value links">',"",$myLine);
$myLine = str_replace('<td class="label">',"Label: ",$myLine);
$myLine = str_replace('<td class="value">',"Valor: ",$myLine);
$myLine = str_replace('<td class="value" itemprop="temporal">',"Valor: ",$myLine);
$myLine = str_replace('<td class="value" itemprop="name">',"Valor: ",$myLine);
$myLine = str_replace('<td class="value" itemprop="name" >',"Valor: ",$myLine);
$myLine = str_replace('<td class="value" >',"Valor: ",$myLine);
$myLine = str_replace('</td>',"",$myLine);
$myLine = preg_replace(array("/\t/", "/\s{2,}/", "/\n/", "/\r/"), array("", " ", " ", " "), $myLine);
echo $myLine;
?>