Forum Moderators: coopster
$caraccessories = array (
'20302' => array('item_number' => '20302','item_name' => '30 Piece Emergency Tool Set','item_price' => '49.95','item_cat' => 'automotive','item_subcat' => 'car-accessories','item_nav'=> '$nav[ca]'),
'30415' => array('item_number' => '30415','item_name' => 'Roadside Travel Kit','item_price' => '12.95','item_cat' => 'automotive','item_subcat' => 'car-accessories','item_nav'=> '$nav[ca]')
);
I want php to find only item's that are priced (index=item_price) $12.95 or below and display the result in the browser.
Can this be done using only php with multi-dimensional arrays -- and without MYSQL?
$array[0]['name'] = "Niko";
$array[0]['age'] = 24;
$array[1]['name'] = "Dennis";
$array[1]['age'] = 34;
the fuction:
function array_csort($marray, $column) {
foreach ($marray as $row) {
$sortarr[] = $row[$column];
}
array_multisort($sortarr, $marray);
return $marray;
}
just use it like that:
$array = array_csort($array,"age");