|
Posted by Craig Lister on 06/20/05 12:48
There is a handy function in PHP:
similar_text
I have a site that I allow users select a town, for example. If the town
doesn't exist yet, they are able to add the town.
This works well, but I find when I present the list of town to them, they
often don't see the one they are looking for, and then just add it.
If they add an already existing town, the system doesn't add it, but simply
selects it and continues. But, use the example of 'Table View' (A town in
South Africa). Lets say it is stored in the database as 'Table View'
(Correctly), and then user enters 'Tableview' (Also used)...
The similar text doesn't pick this up... And the two are added...
Is there a way to check for this? str_replace(' ', '', $thename) doesn't
help, as it breaks the rest of the similar_text checks that do actually
work.
Anyone?
Navigation:
[Reply to this message]
|