Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
TENHO ESTE CODIGO DE XML, MAS ELE NÃO MOSTRA O ERRO.
<?php
$arquivo = 'http://hosting.gmodules.com/ig/gadgets/file/100025145397458874742/climatempo_weather_gadget.xml';
function LeXML( $arquivo, $num_noticias, $thistag, $tag_deep, $noticia_ini, $codificacao )
{
if( !( $abrearquivo = fopen( $arquivo, 'r' ) ) )
{
die( "<strong>Falha ao carregar dados.</strong>" );
}
while (!feof($abrearquivo)) {
$xml = $xml . fgets($abrearquivo);
}
$parser = xml_parser_create();
xml_parse_into_struct($parser, $xml, $dados, $index);
xml_parser_free($parser);
$count = 0;
for( $i = 0; $i < sizeof( $dados ); $i++ )
{
if( $dados[ $i ][ "tag" ] == "LINK" && $dados[ $i ][ "level" ] == $tag_deep )
{
if( $count < $num_noticias + $noticia_ini )
{
if( $count >= $noticia_ini )
{
$link[$count] = '<a href="' . $dados[ $i ]["value"] . '" TARGET="_blank">';
}
$count++;
}
}
}
$count = 0;
for( $i = 0; $i < sizeof( $dados ); $i++ )
{
if( $dados[ $i ][ "tag" ] == $thistag && $dados[ $i ][ "level" ] == $tag_deep )
{
if( $count < $num_noticias + $noticia_ini )
{
if( $count >= $noticia_ini )
{
if( $codificacao == "UTF-8" )
{
echo addslashes($link[$count]) . addslashes(utf8_decode($dados[ $i ]["value"])) . "'</a>";
}
else if( $codificacao == "ISO-8859-1" )
{
echo addslashes($link[$count]) . addslashes($dados[ $i ]["value"]) . "'</a>";
}
}
$count++;
}
}
}
}
?>Carregando comentários...