Programming help - need a way to count up user entered and thus variable data

Discussion in 'General Web Coding' started by skypanther, Nov 2, 2007.

  1. skypanther

    skypanther Exalted Code Master!

    I created a custom site for a client. They're asking for a new feature and I'm not sure I can figure out the logic of how to do it.

    In the app, users from among the general public are asked to enter details about the solar power equipment installed in their homes. One of the data points is the name of the contractor who performed the installation. At my client's request, I present a drop-down list of contractors and there's also a text box into which people can enter a name (the intent was for names not present in the list box).

    Now my client wants a list of installations per contractor. Counting those selected from the list box is simple of course. What's getting me is all those hand-entered values. I get things like:

    Green Logic Energy
    Greenlogic
    GreenLogic Energy
    GreenLogic LLC

    Mixed case, variation in spacing, and variation in wording. Given the similarity of many of the company names, I can't just remove common words like "energy" in an attempt to determine a "core" uniquely identifiable name. I could remove "Inc" and "LLC" I suppose.

    Is there a good way to count these items and get a fairly accurate number? I'll be programming this in PHP, but the logic should apply from any language. This must be a fairly common issue faced by other programmers.

    Thanks,
    Tim

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services