Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、特定の URL から特定の行を取得したいです...このURL から、行 "GBP": 0.632956 を取得したいと思います。preg関数を使用する必要があると思いますが、取得方法の例を教えてください..
ありがとう。
これはJSON応答であるため、正規表現は必要ありません。
$response = file_get_contents('http://openexchangerates.org/api/latest.json?app_id=ae2f63619e8d4cc4bd0beaf9fd73839e'); $data = json_decode($response); echo $data->rates->GBP;
デモ
参照:json_decode()
json_decode()