В каком формате сервер отдает данные ?
quotes.weltrade.com/export/quotes.json тут вроде как Json , но он какой-то странный
Как вытянуть в переменную первую цифру после eurusd
вот код запроса
<?php
$ch = curl_init('http://quotes.weltrade.com/export/quotes.json');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false );
curl_setopt($ch, CURLOPT_POST, true);
$result = curl_exec($ch);
$course = json_decode($result);
var_dump($course);
curl_close($ch);
?>
Вот что выводится
quotes([["d","eurusd","1.16358","1.16365"],["u","gbpusd","1.30248","1.30255"],["d","usdjpy","111.823","111.830"],["d","usdchf","0.95780","0.95791"],["u","audusd","0.79116","0.79123"],["d","nzdusd","0.74272","0.74283"],["u","usdcad","1.25059","1.25069"],["d","eurgbp","0.89332","0.89342"],["d","eurjpy","130.114","130.126"],["d","eurchf","1.11455","1.11466"],["d","gbpjpy","145.646","145.663"],["d","gbpchf","1.24755","1.24774"],["d","xauusd","1247.150","1247.320"],["u","xagusd","16.39900","16.42210"],["d","audcad","0.98942","0.98955"],["d","audchf","0.75780","0.75792"],["u","audjpy","88.468","88.480"],["d","audnzd","1.06512","1.06529"],["d","cadchf","0.76581","0.76625"],["d","cadjpy","89.407","89.423"],["d","chfjpy","116.735","116.750"],["u","euraud","1.47067","1.47078"],["d","eurcad","1.45518","1.45534"],["d","eurnok","9.29375","9.29875"],["d","eurnzd","1.56651","1.56672"],["d","eursek","9.56731","9.58331"],["n","eursgd","1.67488","1.67488"],["d","gbpaud","1.64617","1.64636"],["d","gbpcad","1.62885","1.62910"],["d","gbpnzd","1.75343","1.75375"],["n","gbpsgd","2.01423","2.01423"],["d","nzdcad","0.92874","0.92909"],["d","nzdchf","0.71133","0.71166"],["d","nzdjpy","83.044","83.074"],["n","sgdjpy","90.167","90.167"],["d","usddkk","6.38884","6.39284"],["d","usdhkd","7.81181","7.81211"],["u","usdnok","7.98806","7.99025"],["u","usdsek","8.22649","8.23149"],["d","usdsgd","1.36329","1.36343"],["d","usdzar","13.05285","13.06775"],["u","usdtry","3.56215","3.56265"],["u","usdrub","59.96700","60.00096"],["u","eurrub","69.76864","69.81570"],["u","usdcnh","6.75348","6.75420"],["u","xpdusd","853.550","858.350"],["d","xptusd","922.820","927.301"],["d","xtiusd","48.30","48.35"],["u","xbrusd","50.62","50.69"],["u","uk100","7486.7","7489.4"],["d","ws30","21648.0","21655.0"],["u","spx","2481.2","2482.6"],["u","ndx","5936.0","5938.8"],["u","gdaxi","12308.9","12311.5"],["u","fchi","5203.4","5206.2"],["d","stx50e","3491.8","3495.2"],["d","j225","20051.0","20061.0"],["d","aus200","5781.3","5787.3"]])int(1)