3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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;
based on bJoMI
Output for 5.3.20 - 5.4.45, 5.5.29, 5.5.34, 5.6.13 - 5.6.14, 5.6.20, 5.6.28, 7.0.20 - 7.2.0
1***1
Output for 5.5.25, 5.6.8, 5.6.21, 7.0.6
1***3
Output for 5.5.30, 7.0.5
1***0
Output for 7.0.4
8***0
Output for 7.0.3
8***8
Output for 7.0.2
9***3
Output for 7.0.1
9***4
Output for 7.0.0
9***7
Output for 5.6.19
7***8
Output for 5.6.18
8***5
Output for 5.6.17
9***0
Output for 5.6.16
9***8
Output for 5.6.15
9***9
Output for 5.5.26 - 5.5.28, 5.6.9 - 5.6.12
1***2
Output for 5.5.24, 5.5.35
1***5
Output for 5.5.33
7***9
Output for 5.5.32
8***7
Output for 5.5.31
9***1