배열(크기=15)
0 =>
<code>array (size=2) 'time' => string '2016-04-14' (length=10) 'frequency' => string '3' (length=1)</code>
1 =>
<code>array (size=2) 'time' => string '2016-04-22' (length=10) 'frequency' => string '5' (length=1)</code>
2 =>
<code>array (size=2) 'time' => string '2016-04-23' (length=10) 'frequency' => string '1' (length=1)</code>
3 =>
<code>array (size=2) 'time' => string '2016-04-24' (length=10) 'frequency' => string '2' (length=1)</code>
4 =>
<code>array (size=2) 'time' => string '2016-04-25' (length=10) 'frequency' => string '16' (length=2) </code>
배열(크기=15)
0 =>
<code>array (size=2) 'time' => string '2016-04-14' (length=10) 'amount' => string '18.00' (length=5)</code>
1 =>
<code>array (size=2) 'time' => string '2016-04-22' (length=10) 'amount' => string '54.00' (length=5)</code>
2 =>
<code>array (size=2) 'time' => string '2016-04-23' (length=10) 'amount' => string '6.00' (length=4)</code>
3 =>
<code>array (size=2) 'time' => string '2016-04-24' (length=10) 'amount' => string '12.00' (length=5)</code>
4 =>
<code>array (size=2) 'time' => string '2016-04-25' (length=10) 'amount' => string '48.00' (length=5) </code>
배열(크기=15)
0 =>
<code>array (size=2) 'time' => string '2016-04-14' (length=10) 'number' => string '1' (length=1)</code>
1 =>
<code>array (size=2) 'time' => string '2016-04-22' (length=10) 'number' => string '5' (length=1)</code>
2 =>
<code>array (size=2) 'time' => string '2016-04-23' (length=10) 'number' => string '1' (length=1)</code>
3 =>
<code>array (size=2) 'time' => string '2016-04-24' (length=10) 'number' => string '1' (length=1)</code>
4 =>
<code>array (size=2) 'time' => string '2016-04-25' (length=10) 'number' => string '2' (length=1) </code>
같은 형식의 다차원 배열이 여러개 있는데 시간의 가치에 따라 다음과 같은 효과로 병합하고 싶습니다
해결 방법을 알려주세요
배열(크기=15)
0 =>
<code>array (size=2) 'time' => string '2016-04-14' (length=10) 'frequency' => string '3' (length=1)</code>
1 =>
<code>array (size=2) 'time' => string '2016-04-22' (length=10) 'frequency' => string '5' (length=1)</code>
2 =>
<code>array (size=2) 'time' => string '2016-04-23' (length=10) 'frequency' => string '1' (length=1)</code>
3 =>
<code>array (size=2) 'time' => string '2016-04-24' (length=10) 'frequency' => string '2' (length=1)</code>
4 =>
<code>array (size=2) 'time' => string '2016-04-25' (length=10) 'frequency' => string '16' (length=2) </code>
배열(크기=15)
0 =>
<code>array (size=2) 'time' => string '2016-04-14' (length=10) 'amount' => string '18.00' (length=5)</code>
1 =>
<code>array (size=2) 'time' => string '2016-04-22' (length=10) 'amount' => string '54.00' (length=5)</code>
2 =>
<code>array (size=2) 'time' => string '2016-04-23' (length=10) 'amount' => string '6.00' (length=4)</code>
3 =>
<code>array (size=2) 'time' => string '2016-04-24' (length=10) 'amount' => string '12.00' (length=5)</code>
4 =>
<code>array (size=2) 'time' => string '2016-04-25' (length=10) 'amount' => string '48.00' (length=5) </code>
배열(크기=15)
0 =>
<code>array (size=2) 'time' => string '2016-04-14' (length=10) 'number' => string '1' (length=1)</code>
1 =>
<code>array (size=2) 'time' => string '2016-04-22' (length=10) 'number' => string '5' (length=1)</code>
2 =>
<code>array (size=2) 'time' => string '2016-04-23' (length=10) 'number' => string '1' (length=1)</code>
3 =>
<code>array (size=2) 'time' => string '2016-04-24' (length=10) 'number' => string '1' (length=1)</code>
4 =>
<code>array (size=2) 'time' => string '2016-04-25' (length=10) 'number' => string '2' (length=1) </code>
같은 형식의 다차원 배열이 여러개 있는데 시간의 가치에 따라 다음과 같은 효과로 병합하고 싶습니다
해결 방법을 알려주세요
배열이 시간별로 정렬되어 있고 길이가 같은 경우
<code class="php">$new_arr = []; foreach ($arr as $key=>$value) { $new_arr[$key] = [ 'time' => $arr[$key]['time'], 'frequency' => $arr[$key]['frequency'], 'other' => $arr2[$key]['other'] ]; }</code>