i was searching how to calculate values in an array loop, a foreach preciselly.
The problem is that i have to calculate the days between dates of this result.
Example:
<ul>
<?php
$values[] = array('example'=>'example1','date'=>'2016-25-12');
$values[] = array('example'=>'example2','date'=>'2016-26-12');
$values[] = array('example'=>'example3','date'=>'2016-28-12');
$values[] = array('example'=>'example4','date'=>'2016-30-12');
foreach($values[] as $example){
echo "<li>".$example['example']." - ".$example['date']." - ".$DAYS BETWEEN EACH DATE$."</li>";
}
?>
</ul>
To become something like this:
example1 - 2016-25-12 example1 - 2016-26-12 - 1 day(s) example1 - 2016-28-12 - 2 day(s) example1 - 2016-30-12 - 2 day(s)How can i make this calc? *the first shows nothing because its the first register.. the others shows how many days passed between the actual row and the last one (above).
Ty.