Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
my basic clock in php
#1
Demo:
http://bmx3r.com/clock/clock.php

Images:
http://bmx3r.com/clock/
you have to grab images or use your own numbers.

Php code:

PHP Code:
$hours date("h");
$minutes date("i");
$seconds date("s");
$ampm date("a");
$hours1substr("$hours"01);
$hours2 substr("$hours"11);
$minutes1 substr("$minutes"01);
$minutes2 substr("$minutes"11);
$seconds1 substr("$seconds"01);
$seconds2 substr("$seconds"11);
/* AM or PM */
if($ampm == "am")
{
$time_ampm "am.gif";
}
else
{
$time_ampm "pm.gif";
}

/* hours*/
print "<img src=\"$hours1.gif\"><img src=\"$hours2.gif\"><img src=\"colon.gif\">";

/* minutes */
print "<img src=\"$minutes1.gif\"><img src=\"$minutes2.gif\"><img src=\"colon.gif\">";

/* seconds and AM or PM */
print "<img src=\"$seconds1.gif\"><img src=\"$seconds2.gif\"><img src=\"$time_ampm\">"
Reply


Messages In This Thread
my basic clock in php - by ELY_M - 02-17-2010, 01:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 936 07-27-2020, 11:26 PM
Last Post: tk-hassan
  [PHP] Very Basic Login Page BreShiE 17 7,916 07-11-2013, 05:57 AM
Last Post: 1n9i9c7om ツ
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,660 10-10-2011, 01:00 PM
Last Post: Greyersting

Forum Jump:


Users browsing this thread: 1 Guest(s)