Algorithms Arrays Passwords Uncategorized
Commerce Uncategorized
Databases Abstraction Layers Informix LDAP MS SQL MySQL ODBC PostgreSQL Uncategorized
Date & Time Calculators Conversion Translation Uncategorized
Discussion Chat Forums Guestbooks Polls Uncategorized
Email Validation Uncategorized
External Uncategorized
Files and Directories Uncategorized
Games Uncategorized
Graphics 3-D Graphs Resizing Thumbnails Uncategorized
HTML Forms Menus & Navigation Source Viewers Tables Templates Uncategorized
HTTP Authentication Cookies File Uploading Uncategorized
I18N Uncategorized
Math Uncategorized
Miscellaneous Uncategorized
Searching and Trees Uncategorized
Security Uncategorized
Text Uncategorized
Utilities Calendars Counters Link Checkers Weather Uncategorized
XML Uncategorized
| php sample source codes |
|---|
|
Age calculator (which works)
|
|
Convert base 10 int to any other base up to 16.
This function will take a take two integer values. The first is the base you want to convert to, the second is the base 10 number you are converting.
|
|
The Greatest Common Denominator of two large numbers, using BCMath functions.
Please read the PHP manual for BCMath requirements.
It works even for those who cannot have GMP support in their PHP distribution, for instance due to the web host policy.
|
|
This script does Addition and Subtraction without once using the + or - operators. Good example of how to use bitwise operators.
|
|
this program prompts for means, standard dev, and sample sizes of both groups, and calculates the p-value of unpaired t-test of two independent group.
|
|
A function that converts numbers with decimal remainders to numbers with fractional remainders.
|
|
Two functions to convert an integer to its equivalent in the roman number- system or vice versa.
|
|
An application for doing exact integer computations. Uses bcmath functions of PHP. The Euclidean Algorithm and the Sieve of Erotesthenes are implemented.
|
|
This is a port of the FFT code in NR to PHP. The size of the input array must be an integer power of two. Main website at http://www.mathewbinkley.org/fft.php
|
|
Allows manipulation and display of a fraction. Useful for displaying float/double as a fraction as opposed to a decimal number, i.e. 1/2 instead of 0.5, or a better example is 1/3 instead of 0.333333. :-)
|
|
A simple class that finds the greatest common denominator for two integers.
|
|
simple function to determine if a number is even or odd.
|
|
Simple linear regression class
|
|
With this class you can convert your integer/number to english fraction words. Ex. 1=>One, 250=>Two hundred fifty, 1000=>One thousand. Give it a try.
|
|
fmtnum() takes a number and formats it for easy reading. It can convert a number to scientic notation or return it with quantifier attached. For example, you could use it to format the number 12345678 into 1x10+7 or 12.34 M.
|
|
Feed it "21" and it returns "21st". Prints any number with the appropriate English ordinal suffix.
|
|
The code fragment (function) allows to find the scheme of all possible combinations of a given number of elements and will return the array with all combinations. Optionally it allows to find also the combinations that dont include all elements. The examples show how to apply the code.
Idea/basics of the code were taken from a nice contribution here: http://www.phpfreaks.com/phpref/21.php
|
|
Find the PI value with these routines.
Try come closer to 3.14159265358979323846!!!
|
|
Takes a number like 1000.000001 and rounds it to 1001, or 1000.9 and rounds it to 1001
I made this for my paginator which gets the total pages then divides by amount per page, sometimes it returns 1.1 or 1.00001 etc, so it rounds it up for a solid number to use for the paginator
|
|
Calculation of a determinant of a matrix of the any order on the first line
|
|
returns TRUE if the number is even, FALSE if not
|
|
take for example, you want to have 2 significiant digits, then
3.34 => 3.3
0.003445 => 0.0034
345.45 => 340
1 => 1.0
0.02 => 0.020
3.45e-4 => 0.00034
0 => 0.0
|
|
A simple Add, Subtract, Multiply, and Divide Calculator. This is a short example of a form, data validation, commenting, CSS, HTML, and rather neat code.
Beginners may benifit from the source code contained within.
|
|
A simple function designed to calculate the standard deviation of an array of values.
|
|
Calculates the Standard Deviation of an array of numerical values.
|
|
This is a statistic class that accepts one or two unidimensional arrays of data.
It returns a stat array using the getStats() method.
If only one array is sent, it will return the min,max, sum, median, average and standard deviation for this array. If two arrays are sent, in addition to these values for both
arrays, a linear regression line is computed with its correlation r and 't'test.
Median correction applied on 02/26/01.
|
|
skewness , kurtosis and mean or average statistical function
|
|
It takes in a string like 12345.123 and it will convert it to the normal money format 12,345.12
|