Coder Profile - Show off your skills, get a coder profile.
 
 
 
The Author
VBAssassin
Scott Thompson
Send A Message
Rating
Not
Rated
Please login to rate source codes.

Click here to register a free account with us.
General Details
PHP (Hypertext Preprocess...
Posted 110 Days Ago
442 Views
Received 0 Ratings
More Codes By This Author
Make maxlength='' work on...
Dynamic Transparent GIF P...
To Do List (With Effects)
Breadcrumb Function
Remove Transparency
Articles By This Author
Speed Up Delivery of your...
AJAX - When to use it?
Null Byte Poison - How it...
Versioning Your Applicati...
When to use OOP in PHP

Pool of Random Numbers (Class)


Description
Creates a pool of numbers that you can add individually, or by setting a range. Then each time you call the get_number() method a random number will be selected from the pool and returned for you to use in your code or to print to the browser. Once a number has been taken from the pool using get_number() it will be removed from the pool to prevent it being used again.
Technical
Using PHP 4, and is compatible with PHP 5.

add_range($min, $max)

Setting $min as 1 and $max as 10 would result in the following numbers being available in the pool: 1,2,3,4,5,6,7,8,9,10

add_number($number)

Will allow you to add one number at a time.

Since i have not added numeric datatype checking to the add_number method, you can add strings to the pool and they will be selected in the same was as if they were numbers!
Source Code
Comments
Please login to post comments.
Page 1 of 1
More "PHP (Hypertext Preprocessor)" Source Codes By This Author
Recently Posted "PHP (Hypertext Preprocessor)" Source Codes
Recently Rated "PHP (Hypertext Preprocessor)" Source Codes
 
 
Part of the MyPingle Network
Development Blog :: Make A Donation :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents
Version 1.44.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved