3v4l.org

run code in 300+ PHP versions simultaneously
<?php $market_hash_name = 'AK-47 | Aquamarine Revenge (Battle-Scarred)'; $json = '{ "status" : "success", "prices" : [ { "market_hash_name" : "AK-47 | Aquamarine Revenge (Battle-Scarred)", "price" : "15", "created_at" : 1460708937 }, { "market_hash_name" : "AK-47 | Aquamarine Revenge (Factory New)", "price" : "41.4", "created_at" : 1460708934 } ] }'; $arr = json_decode($json, true); foreach($arr['prices'] as $key => $val){ if($val['market_hash_name'] == $market_hash_name){ echo $val['price']; } }

preferences:
102.33 ms | 2082 KiB | 5 Q