<?php
/* RandomDigit 1.0 -- Copyright 1998 by Michael A. Smith -- msmith@dn.net
This function returns a random string of a specified number of digits
without leading zeros. For example, if three digits are specified, the
function will return a random three-digit number from 100 to 999. If you
specify an eight-digit string you will not get numbers with fewer than
eight digits, e.g. 376 or 6. */
function randomdigit($digits) {
static $startseed = 0;
if (!$startseed) {
$startseed = (double)microtime()*getrandmax();
srand($startseed);
}
$range = 8;
$start = 1;
$i = 1;
while ($i<$digits) {
$range = $range . 9;
$start = $start . 0;
$i++;
}
return (rand()%$range+$start);
}
?>
Calculate the great circle distance between two latitude/longitudes
Categories : Algorithms , PHP 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 Function to convert Arabic numbers into Roman Numerals Categories : Algorithms , PHP , Date Time Timer - a class that uses microtime() to provide easy calculation of elapsed times Categories : Algorithms , PHP , PHP Classes How to judge if an integer is odd or is even in Php3? Categories : Math. , PHP , Algorithms 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 quick sort for associative arrays Categories : Algorithms , Arrays , PHP Dollar Serial Number Validator Categories : PHP , Security , Algorithms Boolean Keyword Interpreter Categories : PHP , Algorithms , Search Engines Prime number finder (Sieve of Erastothenes) Categories : PHP , Algorithms , Math. A recursive function to traverse a multi-dimensional array where the
dimensions are not known Categories : Arrays , PHP , Algorithms The Porter Word Stemming Algorithm in PHP
Reduces words to their base stem for search engines and indexing Categories : Algorithms , PHP , Strings Kasskooye($path) tell you the complete size of a folder
Categories : PHP , Algorithms , Utilities , Filesystem How to validate an Israeli ID number. Categories : Ecommerce , PHP , 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