I have an array with the following data, I am trying to find the column with the lowest price and then get the associated row data (stock and supplier) value, I have managed to get the lowest price but am not sure how to get the associated row data for stock and supplier, any adivce. Thanks
$productdata=array
(
array('Price'=>$row['price1'],'Stock'=>$row['stock1'],'Supplier'=>$row['supplier1']),
array('Price'=>$row['price2'],'Stock'=>$row['stock2'],'Supplier'=>$row['supplier2']),
array('Price'=>$row['price3'],'Stock'=>$row['stock3'],'Supplier'=>$row['supplier3'])
);
$filtered_array = array_filter($productdata, function($v) {
return $v['Price'];});
$minprice= min( array_column( $filtered_array, 'Price') );
print_r($minprice);