title: Data Structure of Wordpress' get_posts function?
body: <p>I am working with Wordpress, and trying to get the information from all the posts created the current day. My code currently looks like this:</p>
  
  <pre><code>        $today = getdate();
   $posts = get_posts('year=' .$today["year"] .'&amp;monthnum=' .$today["mon"] .'&amp;day=' .$today["mday"] );
  
   $CurrentPost = array($posts[0]);
  
   $Post_Date = $CurrentPost[post_date];
   echo "Post Date: $Post_Date ";
  </code></pre>
  
  <p>However, I am getting NULL for Post Date. Am I accessing the data structure correctly? I know that there is data there, because when I do a print_r on the $posts array, I get the following:</p>
  
  <pre><code>Array ( [0] =&gt; stdClass Object ( [ID] =&gt; 4 [post_author] =&gt; 1 [post_date] =&gt; 2011-01-01 02:59:09 [post_date_gmt] =&gt; 2011-01-01 02:59:09 [post_content] =&gt; This Post created Friday December 31st, 2010 [post_title] =&gt; Test Post 1 [post_excerpt] =&gt; [post_status] =&gt; publish [comment_status] =&gt; open [ping_status] =&gt; open [post_password] =&gt; [post_name] =&gt; test-post-1 [to_ping] =&gt; [pinged] =&gt; [post_modified] =&gt; 2011-01-01 02:59:09 [post_modified_gmt] =&gt; 2011-01-01 02:59:09 [post_content_filtered] =&gt; [post_parent] =&gt; 0 [guid] =&gt; http://localhost/wordpress/?p=4 [menu_order] =&gt; 0 [post_type] =&gt; post [post_mime_type] =&gt; [comment_count] =&gt; 0 [filter] =&gt; raw ) [1] =&gt; stdClass Object ( [ID] =&gt; 1 [post_author] =&gt; 1 [post_date] =&gt; 2011-01-01 02:43:02 [post_date_gmt] =&gt; 2011-01-01 02:43:02 [post_content] =&gt; Welcome to WordPress. This is your first post. Edit or delete it, then start blogging! [post_title] =&gt; Hello world! [post_excerpt] =&gt; [post_status] =&gt; publish [comment_status] =&gt; open [ping_status] =&gt; open [post_password] =&gt; [post_name] =&gt; hello-world [to_ping] =&gt; [pinged] =&gt; [post_modified] =&gt; 2011-01-01 02:43:02 [post_modified_gmt] =&gt; 2011-01-01 02:43:02 [post_content_filtered] =&gt; [post_parent] =&gt; 0 [guid] =&gt; http://localhost/wordpress/?p=1 [menu_order] =&gt; 0 [post_type] =&gt; post [post_mime_type] =&gt; [comment_count] =&gt; 1 [filter] =&gt; raw ) )
  </code></pre>
  
  <p>I would like to be able to just access each element in each post directly as if calling it from an array so I can generate a non-html output of the posts written the current day. Any advice would be greatly appreciated.</p>