Zend - The PHP Company




Algorithms

Add Code


Check israeli Teudat Zehut number  

Type: code fragment
Added by: ols
Entered: 12/08/2003
Last modified: 06/12/2008
Rating: - (fewer than 3 votes)
Views: 5447
Checks validity of Israeli interim ID number (teudat zehut) using algorithm described in http://www.halemo.com/info/idcard (the link in Hebrew).


checkdigit modulo 10  

Type: code fragment
Added by: ulflun
Entered: 02/11/2001
Last modified: 01/12/2010
Rating: *** (5 votes)
Views: 6432
Calculates the checkdigit, cdv 10, for either a integer or string value. Cdv10 are often used in account-numbers etc.


chopSent  

Type: code fragment
Added by: Kriek
Entered: 04/12/2003
Last modified: 05/12/2008
Rating: ** (4 votes)
Views: 3893
chopSent is very simplistic script/function intended to limit the character output of a given string and emphasize that the string does indeed continue, however input source is NOT limited, so use your imagination.


Convert IP string (XXX.YYY.WWW.ZZZ) to integer  

Type: application
Added by: kirill
Entered: 03/03/2000
Last modified: 08/12/1999
Rating: *** (22 votes)
Views: 14209
Convert IP string (XXX.YYY.WWW.ZZZ) to integer


Convert to base 10.  

Type: application
Added by: zak
Entered: 19/11/2000
Last modified: 01/12/2000
Rating: **** (3 votes)
Views: 8977
Shows the steps involved in converting a number from a given base to base 10. I wrote the example for a book, but after I was mostly finished it, it seemed too off topic. I hope that someone finds it useful. :)


CRC check sum  

Type: code fragment
Added by: ayu
Entered: 06/06/2001
Last modified: 07/12/2006
Rating: **** (5 votes)
Views: 7686
Function that calculates the CRC check sum of the given file. This will help you to write a file download script for EzWeb(a famouse WAP service in Japan).


creating unique ids (strings)  

Type: code fragment
Added by: charles_killian
Entered: 04/10/2000
Last modified: 01/12/2000
Rating: ***** (4 votes)
Views: 9085
Below are two functions I use to create unique ids: The first uses unique_id() and md5(). (I think I copied it from the manual). The second is useful if you want to restrict the unique id to a specific length and character set ( I think I copied it from Core PHP).


domain class  

Type: class
Added by: mahype
Entered: 04/02/2004
Last modified: 09/12/2007
Rating: - (fewer than 3 votes)
Views: 6965
This class returns the whois information an checks the availability of at least 250 different top level domains. Also it validates the domains name (Thought have been given to the new IDN special chars). CNO WHOIS informations where returned completely.


Fatal Error Notifier  

Type: application
Added by: kevinkorb
Entered: 19/03/2006
Last modified: 08/12/2006
Rating: - (fewer than 3 votes)
Views: 3743
This runs as a cron job and notifies the administrator of all the php fatal errors that happened in the last specified time. This is a low-overhead solution to fatal error reporting.... some solutions suggested output buffering each page, running a regex, but that has huge overhead. Others say no production code should ever have fatal errors. However, in my business we maintain many different sites each low budget and testing may not always be efficent. Sometimes a change on one file affects our code in more than one place and we forget to look somewhere and fatal errors happen. This has saved our butt a few times.


Fuzzy Logic  

Type: code fragment
Added by: joeldg
Entered: 09/10/2002
Last modified: 31/10/2001
Rating: - (fewer than 3 votes)
Views: 8585
Just a quick fuzzy logic algorithm I whipped up out of some C code for a project I am working on.


hex2bin  

Type: code fragment
Added by: dziadek
Entered: 04/01/2001
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 6359
easy function to convert hexdata to bindata. It's very good to use decode mcrypt hexdata.


Integer to IP string  

Type: code fragment
Added by: kirill
Entered: 03/03/2000
Last modified: 08/12/1999
Rating: *** (3 votes)
Views: 9459
Convert integer to IP (XXX.YYY.WWW.ZZZ)string


Lat_Long_2_Miles  

Type: code fragment
Added by: farrukh
Entered: 04/12/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 6576
Computes the shortest distance between 2 points (locations) on the earth surface given the Latitude/Longitude.


Linked List Using PHP  

Type: class
Added by: panji6887
Entered: 22/06/2006
Last modified: 09/12/2005
Rating: - (fewer than 3 votes)
Views: 4726
this class i made when i learning data structure and algorithm . linked list usually made from compiled programming language or programming language that have Pointer. but i try to make linkedlist using PHP nothing diference . this class implements single linked list that just have one pointer (next). this class can use to make stack or queue using linkedlist more info please contact me


Monthly Calendar/Schedule  

Type: application
Added by: boanerges
Entered: 13/12/2003
Last modified: 02/11/2002
Rating: - (fewer than 3 votes)
Views: 8428
Simple customisable (colors, fonts etc) calendar. Dates are clickable to navigate to a schedule or events for any day in the current month.


More accurate Lat/long comparison  

Type: code fragment
Added by: michaeldouma
Entered: 28/03/2000
Last modified: 08/12/1999
Rating: ***** (5 votes)
Views: 7828
Distance in miles between two lan/lon pairs. Uses spherical geometry.


Numbers Game Solver  

Type: application
Added by: codewalkers
Entered: 13/12/2003
Last modified: 02/11/2002
Rating: - (fewer than 3 votes)
Views: 6359
This code solves the "numbers game", a popular UK television show. It is a winner of the Codewalkers PHP Coding Contest. See example URL for more info.


qds  

Type: application
Added by: spectronix
Entered: 11/01/2011
Last modified: 03/12/2010
Rating: - (fewer than 3 votes)
Views: 803
qwdqwd


Query builder  

Type: application
Added by: zecius
Entered: 03/05/2004
Last modified: 05/12/2003
Rating: - (fewer than 3 votes)
Views: 6627
The query builder builds a query as per the previous HTML page selections /* previous HTML page */ create an html page with multiple select boxes (multiple select) and put three radio buttons as for operators (and, or , none). As per the users selection the query will be generated on this page. This tools uses a fixed query string and also an array. All the conditions are pushed into an array.After the conditions are decided the arroy is converted into a ',' comma separated string containing the conditions. here $access is a variable through which we control the access to the system


RC4 encryption function  

Type: code fragment
Added by: danzarrella
Entered: 06/02/2002
Last modified: 02/12/2001
Rating: **** (5 votes)
Views: 10529
A very easy to use RC4 function, written entirely in php, using the function on plaintext returns the Encrypted string and using it on encrypted text returns the plaintext... its that simple. The security of the algorythmn is dependant on the size of the key used and any size key can be used with this function.


Shortest Route - Contest Winner Script  

Type: application
Added by: stuartc1
Entered: 26/08/2003
Last modified: 08/12/2002
Rating: - (fewer than 3 votes)
Views: 8540
This script came first place in the PHP-Editors.com PHP Programming Contest (Pizza Dude). The script find the shortest route to multiple destinations using a single and double route path.


Trilite Player  

Type: application
Added by: codewalkers
Entered: 29/06/2003
Last modified: 06/12/2002
Rating: - (fewer than 3 votes)
Views: 7536
This is a winner of the PHP Coding Contest at Codewalkers.com. This program will play the game of trilite.


Turing Number Generate  

Type: code fragment
Added by: saneesh
Entered: 01/09/2004
Last modified: 09/12/2003
Rating: - (fewer than 3 votes)
Views: 6864
Its Generating a simple Turing Number with background image,place the mouse over the image if the number is not clear



Search



This Category All Categories