WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Timer - a class that uses microtime() to provide easy calculation of elapsed times
Categories : Algorithms, PHP, PHP Classes Update Picture
David Sklar
Date : Jan 16th 1999
Grade : 1 of 5 (graded 1 times)
Viewed : 8394
File : No file for this code example.
Images : No Images for this code example.
Search : More code by David Sklar
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?

class c_Timer {
var $t_start = 0;
var $t_stop = 0;
var $t_elapsed = 0;


function start() { $this->t_start = microtime(); }

function stop() { $this->t_stop = microtime(); }

function elapsed() {
if ($this->t_elapsed) {
return $this->t_elapsed;
} else {
$start_u = substr($this->t_start,0,10);
$start_s = substr($this->t_start,11,10);
$stop_u = substr($this->t_stop,0,10);
$stop_s = substr($this->t_stop,11,10);
$start_total = doubleval($start_u) + $start_s;
$stop_total = doubleval($stop_u) + $stop_s;

$this->t_elapsed = $stop_total - $start_total;

return $this->t_elapsed;
}
}
};

/* Here's an example usage:

$timer = new c_Timer;

$timer->start();
echo "<hr>";
$timer->stop();

echo $timer->elapsed();

*/
?>



Credit Card Identification and Validation Class - The credit_card class provides methods for cleaning, validating and identifying the type of credit card numbers.
Categories : PHP, PHP Classes, Credit Cards, Ecommerce, Algorithms
Object() = Custom __autoload + Singleton. "automagically" instantiates a class and always retuns the same instance of the same class. It's pretty useful when you want to have persistence in objects.
Categories : PHP, PHP Classes, Algorithms
Password Creator: This PHP code exmaple shows how to use bitwise operations on a single variable and using it as a flagged variable. The class generates passwords of a given length using specified characters and the flags.
Categories : PHP, PHP Classes, Algorithms, Security
This code generates an MD5 protected string, which can be used to hand off to other web pages, or even other sites.
Categories : Algorithms, PHP, PHP Classes
A class to put get and post variables in hidden form elements. Works on scalars, normal arrays, associative arrays.
Categories : Algorithms, Variables, Arrays, PHP, PHP Classes
Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example.
Categories : PHP, Date Time, PHP Classes, Calendar
The GTV.class allows you to extract a value between any HTML tag or between any TEXT on a web page.
Categories : PHP, PHP Classes, Regexps
Password reminder
Categories : PHP, PHP Classes, Databases, MySQL, Mail
Snoopy - the PHP net client v0.1
Categories : PHP, PHP Classes
Bs_StopWatch is a class to measure time intervals in microseconds.
Categories : PHP, Date Time, PHP Classes
Form Elements Class
Categories : PHP, PHP Classes, Form Processing
An updated OOP - Inheritance
Categories : PHP, PHP Classes, Object Oriented
PHP Zip Utility
Categories : PHP, PHP Classes, Compression
Function to convert Arabic numbers into Roman Numerals
Categories : Algorithms, PHP, Date Time
3dLib - a class for drawing in 3D space. Supported functions: Line, SetPixel, Polygon, FilledPolygon, etc. 3dChart() function has been added for one-call drawing of 3d charts. Support of mostly used 3d-transformations.
Categories : Graphics, Math., PHP Classes, PHP, Charts and Graphs