Jump to content

Grouping an Array


gaza165

Recommended Posts

I have multiple arrays containing data for each entry.

 

What I am trying to do is group each item in the array by the date which is also in an array.

 

Where do I start??

 

array
  'pubDate' => string 'Mon, 15 Feb 10 00:00:00 +0000' (length=29)
  'title' => 
    object(SimpleXMLElement)[6]
  'description' => 
    object(SimpleXMLElement)[7]
  'guid' => string 'http://www.dailyinfo.co.uk/events.php?colname=Events&period=7&eventday=25&eventmonth=9&eventyear=2010#72741' (length=107)
  'link' => string 'http://www.dailyinfo.co.uk/events.php?colname=Events&period=7&eventday=25&eventmonth=9&eventyear=2010#72741' (length=107)

array
  'date' => 
    array
      0 => string '2010-09-25T01:00:00+01:00' (length=25)
      1 => string '2010-10-02T01:00:00+01:00' (length=25)

-------------------------------------------------------------------------------------------------------------------

array
  'pubDate' => string 'Fri, 26 Feb 10 00:00:00 +0000' (length=29)
  'title' => 
    object(SimpleXMLElement)[5]
  'description' => 
    object(SimpleXMLElement)[8]
  'guid' => string 'http://www.dailyinfo.co.uk/events.php?colname=Events&period=7&eventday=1&eventmonth=10&eventyear=2010#73266' (length=107)
  'link' => string 'http://www.dailyinfo.co.uk/events.php?colname=Events&period=7&eventday=1&eventmonth=10&eventyear=2010#73266' (length=107)

array
  'date' => 
    array
      0 => string '2010-09-25T01:00:00+01:00' (length=25)
      1 => string '2010-09-30T01:00:00+01:00' (length=25)

-------------------------------------------------------------------------------------------------------------------

Link to comment
https://forums.phpfreaks.com/topic/214345-grouping-an-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.