Re: comparing two texts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



jenny mathew wrote:
Untested, very crude:

<?php
$maxlen = max(strlen($text1), strlen($text2));
for ($i = 0; $i < $maxlen; $i++){
if (@$text1[$i] == @$text2[$i]) echo @$text1[$i];
else @echo "<font color=red>$text1[$i]|$text2[$i]</font>";
}
?>

donot you think you program will just bring the server to its foot ,if the text message encountered is very large of order of 40 KB or
larger.is<http://larger.is>there any other efficient method.

40KB isn't large... now, when you're talking about hundreds of MBs of text, then it gets large :) 40KB, with that method, is nothing...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux