- var_dump: documentation ( source)
- time: documentation ( source)
- preg_match: documentation ( source)
- round: documentation ( source)
- floor: documentation ( source)
- max: documentation ( source)
- strtotime: documentation ( source)
<?php
echo max(floor((strtotime('2017-07-10') - time()) / 86400), 1);
echo '<br>';
echo '<br>';
preg_match('#([0-9]+)\-([0-9]+)#', '3-5 dnů', $maa);
var_dump($maa[2]);
echo '<br>';
echo '<br>';
$start = new DateTime('2017-07-07');
$end = new DateTime();
$days = round(($end->format('U') - $start->format('U')) / (60*60*24));
echo $days;