<?php
$datetime1 = new DateTime('01-04-2018');
$datetime2 = new DateTime('10-04-2018');
$interval = $datetime1->diff($datetime2);
echo $interval->format('%R%a days');
PD9waHAKCiAgICAkZGF0ZXRpbWUxID0gbmV3IERhdGVUaW1lKCcwMS0wNC0yMDE4Jyk7CiAgICAkZGF0ZXRpbWUyID0gbmV3IERhdGVUaW1lKCcxMC0wNC0yMDE4Jyk7CiAgICAkaW50ZXJ2YWwgPSAkZGF0ZXRpbWUxLT5kaWZmKCRkYXRldGltZTIpOwogICAgZWNobyAkaW50ZXJ2YWwtPmZvcm1hdCgnJVIlYSBkYXlzJyk7Cg==