Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/04/2012, 13:07
nomakon
 
Fecha de Ingreso: diciembre-2005
Mensajes: 87
Antigedad: 18 aos, 4 meses
Puntos: 3
Exclamacin FUNCION XML2Array

Buenas, tengo el siguiente problema

Utilizo la funcion creada x:

/**
* xml2array() will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
*/


Al obtener el XML

Cdigo:
<xml_api_reply version="1">
<weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0">
<forecast_information>
<city data="Buenos Aires, Ciudad Autnoma de Buenos Aires"/>
<postal_code data="Buenos Aires Argentina"/>
<latitude_e6 data=""/>
<longitude_e6 data=""/>
<forecast_date data="2012-04-11"/>
<current_date_time data="1970-01-01 00:00:00 +0000"/>
<unit_system data="SI"/>
</forecast_information>
<current_conditions>
<condition data="Neblina"/>
<temp_f data="73"/>
<temp_c data="23"/>
<humidity data="Humedad: 72%"/>
<icon data="/ig/images/weather/haze.gif"/>
<wind_condition data="Viento: NE a 8 km/h"/>
</current_conditions>
<forecast_conditions>
<day_of_week data="mi"/>
<low data="17"/>
<high data="26"/>
<icon data="/ig/images/weather/fog.gif"/>
<condition data="Niebla"/>
</forecast_conditions>
<forecast_conditions>
<day_of_week data="jue"/>
<low data="18"/>
<high data="24"/>
<icon data="/ig/images/weather/fog.gif"/>
<condition data="Niebla"/>
</forecast_conditions>
<forecast_conditions>
<day_of_week data="vie"/>
<low data="18"/>
<high data="24"/>
<icon data="/ig/images/weather/fog.gif"/>
<condition data="Niebla"/>
</forecast_conditions>
<forecast_conditions>
<day_of_week data="sb"/>
<low data="16"/>
<high data="23"/>
<icon data="/ig/images/weather/fog.gif"/>
<condition data="Niebla"/>
</forecast_conditions>
</weather>
</xml_api_reply>
Observamos que hay tildes, o . Como hago para que cuando llame mediante file get contents al fichero XML

Cdigo PHP:
$contents file_get_contents($url); 
Este me lo devuelva sin tildes o ?

Ya he probado con esto:

Cdigo PHP:
function QuitarTildes($cadena) {
    
$no_permitidas= array ("","","","","","","","","","","","","","","","","Ù"," ","è","ì","ò","ù","","","â","","î","ô","û","Â","Ê","Î","Ô","Û","","ö","Ö","ï","ä","","","Ï","Ä","Ë"," ");

$permitidas= array ("a","e","i","o","u","A","E","I","O","U","n","N","A","E","I","O","U","a","e","i","o","u","c","C","a","e","i","o","u","A","E","I","O","U","u","o","O","i","a","e","U","I","A","E","%2C");

$texto str_replace($no_permitidas$permitidas ,$cadena);

return 
$texto;

sobre la variable $contents pero nada...

Alguien me ensea el camino ? =)