LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to compare 2 text files by using php code (https://www.linuxquestions.org/questions/programming-9/how-to-compare-2-text-files-by-using-php-code-242487/)

antony_csf 10-14-2004 04:25 AM

how to compare 2 text files by using php code
 
Hi all,


how to compare 2 text files by using php code and return the difference result??

is it regexp can help to do the comparison?

finally would anyone can provide me some references?

or any suggestion

Many thx !!!

Antony

michaelk 10-14-2004 04:54 AM

BTW is this a homework assignment?

antony_csf 10-14-2004 05:01 AM

sorry what is BTW!!

I am not familiar with php !!

I am building a web application !! I just want to know any reference or example by using regular expression or other kind of method to compare to text file. and then highlight it and output it in form of HTML!!

antony_csf 10-14-2004 05:52 AM

hi all,
I find other solution to solve my problem.
and would like to share my method to you.

I am now using the linux command "diff" to compare 2 file and parse the output file and then generate the HTML code.

example :
====================
diff a.txt b.txt > result.txt


:p


All times are GMT -5. The time now is 04:50 PM.