Ver Mensaje Individual
  #7 (permalink)  
Antiguo 15/01/2014, 09:55
mktalternativa
 
Fecha de Ingreso: enero-2012
Mensajes: 224
Antigüedad: 12 años, 3 meses
Puntos: 1
Respuesta: Simple Xml php5

Es verdad gracias

ahora intente asi pero sigue sin darme resultados, muchas gracias por tu aporte

Código PHP:
<?php 


$opciones 
= array(
    
'http'=>array(
        
'method'=>"GET",
        
'header'=>"Content-type: text/xml\r\n",
    )
);
$contexto stream_context_create($opciones);
$data "http://www.eldolarblue.net/getDolarBlue.php?as=xml"
$library file_get_contents($datafalse$contexto); 
$library simplexml_load_string($library);






echo 
'<table>';
echo 
'<tr>';
echo   
'<th>Compra</th>
        <th>Venta</th>'
;
echo 
'</tr>';
foreach( 
$library->eldolarbluedotnet as $dolar ) {
    echo 
'<tr>';
    echo 
'<td>' $dolar->buy '</td>';
    echo 
'<td>' $dolar->sell '</td>';
  

    echo 
'</tr>';
}
echo 
'</table>';


?>

de este xml


Código:
<?xml version='1.0' encoding='UTF-8'?><eldolarbluedotnet>
<url>http://www.eldolarblue.net/</url><datetime>2014-01-15 11:30:03</datetime><exchangerate>
<buy>10.8800</buy><sell>10.9300</sell></exchangerate></eldolarbluedotnet>