A silly question as I can know the data of this Api using PHP this function foreach
I'm forgetting how to use but what I want is to know the name
and price_usd
$tick = file_get_contents('https://api.coinmarketcap.com/v1/ticker/');
$url = $tick;
//$json = file_get_contents($url);
$json = json_decode($tick, TRUE);
foreach ( $json as $data ) {
foreach ( $data as $value ) {
$name = $data[0]["name"];
echo $name;
echo '<br>';
$price_usd = $data[0]["price_usd"];
echo $price_usd;
}
}