Ver Mensaje Individual
  #11 (permalink)  
Antiguo 05/06/2017, 23:01
__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. $url3 = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22BME:SAN%22)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=
  2. ';
  3.  
  4. $data3 = file_get_contents($url3);
  5. $d3 = trim(substr($data3, 7, -2));
  6. $d3 = json_decode($d3);
  7.  
  8. $arr =  explode("columns='", $d3->query->diagnostics->query->content);
  9. $info = substr($arr[1], 0, -1);
  10.  
  11. echo $info;


espero que te sirva