Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- $str = "";
- $day = 8;
- $month = 8;
- $year = 2018;
- $wantedDate = mktime(0, 0, 0, $day, $month, $year);
- $current = time();
- if ($wantedDate < $current)
- $str = "the time has passed.";
- else
- {
- $seconds = $wantedDate - $current;
- $days = floor($seconds/60/60/24);
- $hours = $seconds/60/60%24;
- $mins = $seconds/60%60;
- $secs = $seconds%60;
- if($days>0) $str .= "$days days ";
- if($hours>0) $str .= "$hours hours ";
- if($mins>0) $str .= "$mins minutes ";
- if($secs>0) $str .= "$secs seconds ";
- $str = trim($str);
- if($str==null) $str = '0 seconds';
- }
- $image = imagecreatefromjpeg ("image.jpg");
- $draw_color = imagecolorallocate($image , 0 , 0 , 0);
- $x = 0;
- $y = 0;
- $font = 4;
- $text = $str;
- imagestring($image ,$font , $x , $y , $text , $draw_color);
- header('Content-Type: image/jpg');
- imagejpeg($image);
- echo "<img src =$image>";
- ?>
- </html>
Add Comment
Please, Sign In to add comment