可以使用以下代码来取出所有的amount值:

$json = '{"province": "����","city": "����","isd": "�����","priceList":[{"amount": "30","minprice": "3000","maxprice": "3000","state": "1"},{"amount": "50","minprice": "5000","maxprice": "5000","state": "1"},{"amount": "300","minprice": "30000","maxprice": "30000","state": "1"},{"amount": "100","minprice": "10000","maxprice": "10000","state": "1"}],"bannerName": "","bannerUrl": "","retcode": "0","reterrmsg": "success"}';

$data = json_decode($json, true);

$amounts = array();

foreach ($data['priceList'] as $item) { array_push($amounts, $item['amount']); }

print_r($amounts);

输出结果为:

Array ( [0] => 30 [1] => 50 [2] => 300 [3] => 100 )

province ����city ����isd �����priceListamount 30minprice 3000maxprice 3000state 1amount 50minprice 5000maxprice 5000state 1amount 300minprice 30000maxprice 30000state 1amount 100minprice 10000maxpr

原文地址: https://www.cveoy.top/t/topic/5m2 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录