Nasıl PHP farklı çizgi uçları ile iki metin dosyaları karşılaştırmak mı?

0 Cevap php

I need to compare two text files in php. One file is user uploaded, and the other is supplied by the server, running on windows. This works fine when the file is submitted from another windows computer, but from a linux computer the files come out different, I am assuming this is because of different line endings. Is there an easy way to compare windows text files to linux text files?

Şu anda bu benim kod;

$text1 = file_get_contents($file1);
$text2 = file_get_contents($file2);
if (strcmp($content, $content2) == 0) { etc;

0 Cevap