homepage Welcome to WebmasterWorld Guest from 54.242.229.174
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Detecting possible duplicates
ahmed24




msg:4365287
 11:45 am on Sep 21, 2011 (gmt 0)

I have an array called $names and this array consists of a list of full names fetched from a mysql db. i'm trying to figure out a way to check if any names have a 70% chance of being same as another name within the array and if so to list the ones that maybe duplicated. The reason is because sometimes one name may have been entered few times with different spellings.

Can anyone tell me if there is any way this can be done?

thanks

 

httpwebwitch




msg:4365538
 7:55 pm on Sep 21, 2011 (gmt 0)

first, how will you measure similarity?

You probably want:
[php.net...]

You don't need to compare every element of the array to every other ((n^2)-n)... but to say how many comparisons you need I'll need more coffee in my system

httpwebwitch




msg:4365938
 4:44 pm on Sep 22, 2011 (gmt 0)

formula for number of comparisons in a set is ((n^2)-n)/2

it's done with two nested loops

for ($i = 0 to $len) {
for ($j = $i+1 to $len) {
compare($i,$j);
}}

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved