Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/05/2017, 10:36
__SDP__
 
Fecha de Ingreso: agosto-2010
Ubicación: santiago, CHILE
Mensajes: 564
Antigüedad: 13 años, 8 meses
Puntos: 9
Respuesta: Sacar datos de una URL

Código PHP:
Ver original
  1. $url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22GBPEUR%22)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=';    
  2.              
  3. $data = file_get_contents($url);
  4. $data = json_decode($data);
  5.  
  6.  
  7. echo $data->query->results->rate->Rate;