我从一个JSON结果数组返回如下:usort()不处理正确
["AuctionInfo"]=>
[0]=>
array(13) {
["price"]=>
int(3000)
}
[1]=>
array(13) {
["price"]=>
int(5000)
我的PHP代码,我正在尝试使用只是
<?php
$decoded = json_decode("my json api", true);
foreach($decoded['AuctionInfo'] as $item) {
usort($decoded['AuctionInfo']['price']);?>
<tr>
<td><?php echo $item['price']; ?></td>
</tr>
<?php } ?>
我试过后加入usort($decoded['AuctionInfo']['price']
我foreach
但这只是抛出错误,任何人都可以指出我在正确的方向吗?
所有我想要做的是排序$decoded['AuctionInfo']['price']
降序排列
PLS显示的代码的usort()的一部分..和错误 – 2013-03-25 03:22:42