I'm using a loop to the information from my database and I want to get the difference between the dates within this loop. I can show you how it looks like at the moment (the SQL query with the loop):
$get_photos = "SELECT * FROM photos ORDER BY exif_taken DESC";
foreach($sql->query($get_photos) AS $photo) {
echo $photo['exif_taken'];
}
You can see the loop in action here (removed). The first 2 images you can see in the loop on the website, are taken 2013-10-20. The next four images are taken 10 days before (2013-10-10). The two next images are taken 2013-06-08 and the last image are taken 2013-06-06.
I want to insert a small cap between the images upon date difference. But to do this, I need to get the date difference between the images and it's that I don't know how to do. Let me show you what I mean.
image-1 image-2 new date - small cap image-3 image-4 image-5 image-6 new date - small cap image-7 image-8 new date - small cap image-9
How can I accomplish this?