Code Snippets

  

PHP Source Code


Welcome to Dream.In.Code
Become a PHP Expert!

Join 148,724 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,835 people online right now. Registration is fast and FREE... Join Now!





Command line clock

A demonstration of using Bash or Cmd.exe (Windows Shell) and PHP to make a clock...straight from the command line, no files are used except for those already on your system.

Submitted By: snoj
Actions:
Rating:
Views: 1,836

Language: PHP

Last Modified: June 4, 2006
Instructions: Just copy and post the code into your BASH or Cmd.exe shell. If you're on Windows, you'll need to be in PHP's directory unless you've done my tutorial "Makeing php behave" (http://forums.dreamincode.net/showtopic16184.htm).

Snippet


  1. (clear||CLS) && php -r "set_time_limit(0); echo \"PHP command line clock.\r\nWritten by Josh 'hotsnoj' Erickson for MS Windows XP.\r\nScript started: \".date('M d, Y H:i:s').\"\r\n\r\n\"; while(1) { usleep(100); echo \"\rCurrent time: \".date('M d, Y H:i:s'); }"

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.




Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month