- date_diff: documentation ( source)
- substr: documentation ( source)
- date_create: documentation ( source)
<?php
$datetime1 = date_create();
$datetime2 = date_create('2015-12-21');
$interval = date_diff($datetime1, $datetime2);
$dateshow = $interval->format('%a');
if($dateshow<10){
$leaderday = "0";
$follingday = $dateshow;
}else{
$leaderday = substr($dateshow,0,1);
$follingday = substr($dateshow,1,1);
}
echo $leaderday."***".$follingday;