title: arrays and date in php
body: <p>My var_dump looks like this, I know that I'm getting the error because I'm passing an array instead of a string. But how can I solve it?</p>
  
  <pre><code>array
    0 =&gt; 
      array
        'date_submitted' =&gt; string '2012-03-22 19:28:22' (length=19)
    1 =&gt; 
      array
        'date_submitted' =&gt; string '2012-03-28 21:31:28' (length=19)
  </code></pre>
  
  <p>My function</p>
  
  <pre><code>function getArticle() {
  
      $article = new Article('x');
      $arr = $article-&gt;getArticles();
  
      $date= null;
      foreach($arr as $record){
          $currentDate = date('l, F j', strtotime($record['date_submitted']));
  
          if ($currentDate != $date) {
              echo set_format_date($record['date_submitted'],'l, F j');
          }
          $date = $currentDate;
      }
  }
  </code></pre>
  
  <p>Tried using <code>$x=0;</code> then <code>$x++;</code> but that returns <code>Undefined offset: 0</code>
  like this <code>$record[$x]['date_submitted'];</code> , it didnt work.</p>