Aryan110 Posted February 26, 2021 Share Posted February 26, 2021 i want receive this API JSON : "https://api.cryptowat.ch/markets/binance/btcusdt/ohlc" in PHP And put it in a variable . so i did this : <?php $json= file_get_contents('https://api.cryptowat.ch/markets/binance/btcusdt/ohlc'); $json= json_decode($json , true); foreach ($json as $row){ $price = $row['86400'] ?? ""; print_r($price) ; } and its worked ! but i want to show a specific price like : 86400 / 1122 / 0 and i don't know how ? Quote Link to comment https://forums.phpfreaks.com/topic/312218-how-receive-specific-price-from-json-to-php/ Share on other sites More sharing options...
Solution Barand Posted February 26, 2021 Solution Share Posted February 26, 2021 See 1 Quote Link to comment https://forums.phpfreaks.com/topic/312218-how-receive-specific-price-from-json-to-php/#findComment-1584782 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.