Código PHP:
<?php
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="ISO-8859-1"?>';
require_once("includes/usuariosenlinea/config.php");
$resultado = mysql_query ("SELECT not_ID,titulo,texto,f_alta FROM noticias ORDER BY not_ID DESC");
echo '<rss version="2.0">
<channel>
<title>Asociación Musical CORO</title>
<link>http://www.micoro.org</link>
<descripcion>Web Oficial del Coro</descripcion>';
function cut_string($string, $charlimit)
{
if(substr($string,$charlimit-1,1) != ' ')
{
$string = substr($string,'0',$charlimit);
$array = explode(' ',$string);
array_pop($array);
$new_string = implode(' ',$array);
return $new_string.' ...';
}
else
{
return substr($string,'0',$charlimit-1).' ...';
}
}
while ($row = mysql_fetch_array ($resultado))
{
echo "<item>
<title><![CDATA[".utf8_decode($row['titulo'])."]]></title>
<pubDate>".$row['f_alta']."</pubDate>
<link>http://www.micoro.org/elcoro/noticias/mas.php?not_id=".$row['not_ID']."</link>
<comments>http://www.micoro.org/elcoro/noticias/mas.php?not_id=".$row['not_ID']."
</comments>
<description><![CDATA[".utf8_decode(cut_string($row['texto'],500))."]]></description>
</item>";
}
echo '</channel>
</rss>';
?>
sin embargo tengo el mismo codigo en otra web y funciona todo bien... :S ¿a que es debido?