【发布时间】:2019-11-02 09:08:55
【问题描述】:
我想将以下数组放在一起并计算最优惠的价格。
$pricesForAllCustomer = array(
array(
'from' => '600',
'to' => 'any',
'price' => 0.15
)
);
$customerSpecificPrices = array (
array(
'from' => '1',
'to' => '1799',
'price' => 0.17
),
array(
'from' => '1800',
'to' => 'any',
'price' => 0.14
)
);
如何将这 2 个数组组合起来以达到以下结果?
$calculatedBestOffers = array(
array(
'from' => '1',
'to' => '599',
'price' => 0.17
),
array(
'from' => '600',
'to' => '1799',
'price' => 0.15
),
array(
'from' => '1800',
'to' => 'any',
'price' => 0.14
)
);
谁能帮帮我?
【问题讨论】:
-
到目前为止,您自己有没有尝试过?
-
你的意思是合并而不是合并。 Read this