ある1ヶ月分の日付と曜日の配列があります。
(特定の日が抜けており、連続ではない)
[ 1] => tue
[ 2] => wed
[ 4] => fri
[ 5] => sat
〜
[ 30] => wed
1週間ごと
曜日により野菜を割り当てる配列があります。
$1stWeekAssignment
array (
'tue' => 'tomato',
'wed' => 'carrot',
'fri' => 'carrot',
'sat' => 'tomato',
)
$2ndWeekAssignment
array (
'mon' => 'carrot',
'tue' => 'cabbage',
'wed' => 'potato',
)
e.g.1週目
日曜を始めとして 週ごとに区切り
valueが一致するものをmergeしたいのですが
良い方法はないでしょうか?
$array = [
1 =>['tue','tomato'],
2 =>['wed','carrot'],
4 =>['fri','carrot']