class Photos
{
private $photos = array();
function add_photo($filename, $date, $lat, $long)
{
$this->photos[] = array('filename' => $filename, 'date' => $date, 'lat' => $lat, 'long' => $long);
return $this;
}
function get_all()
{
return json_encode($this->photos);
}
function get_N($n)
{
return json_encode(array_slice($this->photos, 0, $n));
}
}
I would like another function in my class that returns some of the arrays with a certain date. The date is extracted from photos using the exif_read_data function. They look something liek this: 2011:04:01 16:12:23
. The function that im looking for should return all the photos from a certain date. So i would like to know how i make the function return, for example, all photos with a datestamp looking like 2011:04:01 xx:xx:xx
. Hope you understand what i mean. Thanks in advance!