I am required to include a plagiarism detection feature in my final year project: A final year projects portal for my school.
I am using PHP/MySQL and I need code that will help me check this by comparing the content of two text boxes.
I am required to include a plagiarism detection feature in my final year project: A final year projects portal for my school.
I am using PHP/MySQL and I need code that will help me check this by comparing the content of two text boxes.
I down vote your answer, to be fair. But i will help you anyway.
What @Robert told you is good, but in my opinion, in today web 2.0 world, do an ajax request everytime the user type something in a form to check if two strings are similar, is a no go.
So you can use similar_text ported by the php.js project and do it using javascript (i saw the tag in your question).
But here you are talking about plagiarism so maybe you are talkin more about papers/works than just "two text boxes". Maybe you will need more complex algorithms, if so, take a look to the stackoverflow question Algorithm to find similar text
Good luck
Check out this answer: Any easy way to check if two or more characters are equal when comparing a four character string?
Using the similar_text() function in PHP will give you a percentage and you can use that to evaluate if they are similar.
Here is the reference for the method: http://php.net/manual/en/function.similar-text.php
You can use the levenshtein method of comparing two strings (there's a native PHP function of the same name). It returns the number of substitutions required to convert string A to string B, therefore the lower the number the higher the similarity.