|
|
|
<?
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();
*/
?> |
|
| 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 | | | 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 | | | 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 | | | very simple ftp class Categories : PHP, PHP Classes, FTP | | | PHP Paypal IPN Integration Class v1.0.0 Categories : PHP, PHP Classes, Payment Gateways | | | Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET Categories : Algorithms, HTML and PHP, PHP, Variables | | | A Timing Class Categories : PHP, PHP Classes, Date Time | | | The class to check load time of your script
VERY usefull for relatively slow applications, but not only.. Categories : PHP, PHP Classes, Debugging | | | Create HTML forms dynamicly using Javascript & PHP Categories : PHP, PHP Classes, Java Script | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | usercounter class Categories : PHP, PHP Classes, Databases, MySQL, Environment Variables | | | RSS parser.
Parses RSS into an array. Quick and nasty but does the job.
No checking is done for correct Tags, only correct XML.
PHP4 needed to display result (uses print_r). Categories : PHP, XML, PHP Classes, Rich Site Summary (RSS) | | | These PHP Classes Check if a host is alive using various methods. Categories : PHP, PHP Classes, Sockets, CURL | | | an example of the cyberlib payment class Categories : PHP, PHP Classes, Ecommerce, Credit Cards | |
|
|
|