Hi, 1. you might start by removing things which are common problems... make everything lowercase, uppercase, uppercasewords, etc etc (if not permanent, just for comparison). You may also strip out leading and trailing whitespace, multiple spaces, etc etc. You may choose to remove LTD, PTY, GMBH, etc (and all variants) from the string too.
2. you might want to check out the functions that compare the similarity of two strings in a few different ways, for a few different uses. My guess is you'll want similar-text() or levenshtein(): http://www.php.net/manual/en/function.levenshtein.php http://www.php.net/manual/en/function.similar-text.php http://www.php.net/manual/en/function.soundex.php http://www.php.net/manual/en/function.metaphone.php Check out the manual's string section, which is where I found all this :) Cheers Justin on 03/10/02 1:27 AM, DonPro ([EMAIL PROTECTED]) wrote: > Hi, > > I would like some ideas on how to perform the following. Any input from the > PHP gurus would be appreciated. > > I have a form where my customer feels out certain information. Part of this > information is the company name, address, city and state/province of their > customer. I have to assign a unique number to their customer based on the > information they typed in. > > Here is my problem: > > 1) They may enter the same customer twice but have a slightly different > spelling (maybe adding a LTD. to the company name) > 2) Two of my customers may have the same customer. They will type it into my > form but again with variant spelling. > > I would like to know if there is an algorithm which allows me to check for > small variances in spelling so that I would know if this customer has > already been assigned my unique number and therefore not assign a duplicate > number. > > Thanks, > Don > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php