Compare character of text files in php
Suppose I have two text files.
The first one, called reference.txt
has the following content:
dog goat cat
The second one, called compare.txt
has the following content:
cow goat cockroach
I want to compare each character in the 1st and 2nd text files and ignore the whitespace. I've been working it for weeks!
Hope anyone c开发者_StackOverflowan help me out please. Just give an idea, sure it will be enough for me
Thanks
If you are just thinking about doing comparison ignoring white spaces. Here is the general steps:
Read content of first file into a
Read content of second file into a string
Eliminate all white spaces from both the strings( how? left for figuring out)
Do your comparison.
No code provided since you mentioned that you would like to try on your own.
精彩评论