This is what you can use:
http://us3.php.net/file_get_contents[
^].
Read one and another file into string and compare the obtained string the way you need. However, the criteria for "similarity" can be not trivial. I am not sure if it even makes sense, but this is up to you to decide what criteria you need to apply.
—SA