ジャーナルタイプのアプリケーションを作ろうとしています。日付で並べ替えたいので、取得する日付をキーとして、テキストを値として配列に入れます。私がやろうとしているのは、一致するキーが 2 つある場合でも、日付を 1 回だけ表示することです。
したがって、以下の例では、理想的には以下を返します。
1/2/2013
entry 1
entry 2
1/5/2013
this is another day
この入力から:
$array = array('1/2/2013'=>'entry 1', '1/2/2013'=>'entry 2',
'1/5/2013'=>'this is another day');
//loop through array and echo the date and value, but only echo date if havent already