<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to compare text and mark differences using PHP</title>
	<atom:link href="http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/</link>
	<description>sometimes blogging about technologies</description>
	<lastBuildDate>Fri, 25 Nov 2011 03:24:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: umer</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-5702</link>
		<dc:creator>umer</dc:creator>
		<pubDate>Thu, 16 Jun 2011 07:18:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-5702</guid>
		<description>$stringA = &quot;hello world hello world helloo world&quot;;
$stringB = &quot;hello php hello php hello php&quot;;

echo &quot;string 1----&gt;&quot;.$stringA.&quot;&quot;;
echo &quot;string 2----&gt;&quot;.$stringB.&quot;&quot;;

$array1 = explode(&#039; &#039;, $stringA);
$array2 = explode(&#039; &#039;, $stringB);

$result = array_diff($array2, $array1);

$zem= implode(&#039; &#039;,$result);
if (!empty($zem)) {

echo &quot;string diffrence---&gt; &quot;.$zem.&quot;&quot;;


}
else {
echo &quot;string diffrence---&gt;both strings are same &quot;;
}



$a = count(explode(&#039; &#039;, $stringA));
$b= count(explode(&quot; &quot;, $zem));

similar_text($stringA, $stringB , $p);
echo &quot;  similarity between  the stirng is  Percent:&quot;.$p.&quot;% &quot;;</description>
		<content:encoded><![CDATA[<p>$stringA = &#8220;hello world hello world helloo world&#8221;;<br />
$stringB = &#8220;hello php hello php hello php&#8221;;</p>
<p>echo &#8220;string 1&#8212;-&gt;&#8221;.$stringA.&#8221;";<br />
echo &#8220;string 2&#8212;-&gt;&#8221;.$stringB.&#8221;";</p>
<p>$array1 = explode(&#8216; &#8216;, $stringA);<br />
$array2 = explode(&#8216; &#8216;, $stringB);</p>
<p>$result = array_diff($array2, $array1);</p>
<p>$zem= implode(&#8216; &#8216;,$result);<br />
if (!empty($zem)) {</p>
<p>echo &#8220;string diffrence&#8212;&gt; &#8220;.$zem.&#8221;";</p>
<p>}<br />
else {<br />
echo &#8220;string diffrence&#8212;&gt;both strings are same &#8220;;<br />
}</p>
<p>$a = count(explode(&#8216; &#8216;, $stringA));<br />
$b= count(explode(&#8221; &#8220;, $zem));</p>
<p>similar_text($stringA, $stringB , $p);<br />
echo &#8221;  similarity between  the stirng is  Percent:&#8221;.$p.&#8221;% &#8220;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abc</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-5669</link>
		<dc:creator>abc</dc:creator>
		<pubDate>Fri, 06 May 2011 17:44:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-5669</guid>
		<description>+1 to pavel.</description>
		<content:encoded><![CDATA[<p>+1 to pavel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pavel</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-5629</link>
		<dc:creator>pavel</dc:creator>
		<pubDate>Tue, 01 Mar 2011 11:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-5629</guid>
		<description>Hello,
the site http://software.zuavra.net/inline-diff/ which contains function Text_Diff, does not exist..
can anyone send me the function for comparing two PHP texts?
Please upload it on some shararing server like sendspace.com
Thanks A LOT.</description>
		<content:encoded><![CDATA[<p>Hello,<br />
the site <a href="http://software.zuavra.net/inline-diff/" rel="nofollow">http://software.zuavra.net/inline-diff/</a> which contains function Text_Diff, does not exist..<br />
can anyone send me the function for comparing two PHP texts?<br />
Please upload it on some shararing server like sendspace.com<br />
Thanks A LOT.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xandr</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-4433</link>
		<dc:creator>Xandr</dc:creator>
		<pubDate>Fri, 02 Jul 2010 22:02:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-4433</guid>
		<description>Thanks, used :)

But Text_Diff has many warnings in PHP5</description>
		<content:encoded><![CDATA[<p>Thanks, used :)</p>
<p>But Text_Diff has many warnings in PHP5</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Echo</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-3913</link>
		<dc:creator>Echo</dc:creator>
		<pubDate>Fri, 23 Oct 2009 09:01:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-3913</guid>
		<description>Hmm... it appears this comment box strips tags, including my PHP example. Here it is again, without PHP tags.
&lt;code&gt;&lt;pre&gt;
include_once &#039;inline_function.php&#039;;
$nl = &#039;#**!)@#&#039;;
$a = &#039;1 1&#039;;
$b = &#039;1 2&#039;;
ob_start();
inline_diff($a, $b, $nl);
$differences = ob_get_contents();
ob_end_clean();

// $differences now contains the result, and nothing has been output to the browser.
&lt;/pre&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hmm&#8230; it appears this comment box strips tags, including my PHP example. Here it is again, without PHP tags.<br />
<code>
<pre>
include_once 'inline_function.php';
$nl = '#**!)@#';
$a = '1 1';
$b = '1 2';
ob_start();
inline_diff($a, $b, $nl);
$differences = ob_get_contents();
ob_end_clean();

// $differences now contains the result, and nothing has been output to the browser.
</pre>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Echo</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-3912</link>
		<dc:creator>Echo</dc:creator>
		<pubDate>Fri, 23 Oct 2009 08:59:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-3912</guid>
		<description>There&#039;s an easy solution to this problem:



Hope this helps ;)
?&gt;</description>
		<content:encoded><![CDATA[<p>There&#8217;s an easy solution to this problem:</p>
<p>Hope this helps ;)<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pepito</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-3909</link>
		<dc:creator>pepito</dc:creator>
		<pubDate>Tue, 13 Oct 2009 15:38:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-3909</guid>
		<description>lenselijer, 

I&#039;ve got the same problem as you (it echoes before going to variable and the variable is then empty).
Did you find a solution ? If so, what was it ?

Thx !</description>
		<content:encoded><![CDATA[<p>lenselijer, </p>
<p>I&#8217;ve got the same problem as you (it echoes before going to variable and the variable is then empty).<br />
Did you find a solution ? If so, what was it ?</p>
<p>Thx !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Algirdas</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-3884</link>
		<dc:creator>Algirdas</dc:creator>
		<pubDate>Tue, 18 Aug 2009 11:01:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-3884</guid>
		<description>For me there&#039;s nothing shown on screen. I copy/pasted my code where I use it. I don&#039;t know where is your problem.</description>
		<content:encoded><![CDATA[<p>For me there&#8217;s nothing shown on screen. I copy/pasted my code where I use it. I don&#8217;t know where is your problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lenselijer</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-3883</link>
		<dc:creator>lenselijer</dc:creator>
		<pubDate>Tue, 18 Aug 2009 09:57:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-3883</guid>
		<description>When I use:

include_once &#039;inline_function.php&#039;;
$nl = &#039;#**!)@#&#039;;
$a = &#039;1 1&#039;;
$b = &#039;1 2&#039;;
$differences = inline_diff($a, $b, $nl);

The output of $differences is already shown on the screen, and i dont put echo before it. Can it save the output to the variable instead?.

I want to use $differences later on in my php code by using:
$message = str_replace(&#039;{content}&#039;, $differences, $message);
echo $message;

Is this possible? I think it has something to do with echo &quot;$line &quot;; in inline_renderer.php.

I hope you can help me.</description>
		<content:encoded><![CDATA[<p>When I use:</p>
<p>include_once &#8216;inline_function.php&#8217;;<br />
$nl = &#8216;#**!)@#&#8217;;<br />
$a = &#8217;1 1&#8242;;<br />
$b = &#8217;1 2&#8242;;<br />
$differences = inline_diff($a, $b, $nl);</p>
<p>The output of $differences is already shown on the screen, and i dont put echo before it. Can it save the output to the variable instead?.</p>
<p>I want to use $differences later on in my php code by using:<br />
$message = str_replace(&#8216;{content}&#8217;, $differences, $message);<br />
echo $message;</p>
<p>Is this possible? I think it has something to do with echo &#8220;$line &#8220;; in inline_renderer.php.</p>
<p>I hope you can help me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Algirdas</title>
		<link>http://www.varnagiris.net/2009/04/12/how-to-compare-text-and-mark-differences-using-php/comment-page-1/#comment-3881</link>
		<dc:creator>Algirdas</dc:creator>
		<pubDate>Tue, 11 Aug 2009 05:57:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.varnagiris.net/?p=117#comment-3881</guid>
		<description>&lt;code&gt;
include_once &#039;inline_function.php&#039;;
$nl = &#039;#**!)@#&#039;;
$text_with_marked_differences = inline_diff($original_text, $modified_text, $nl);
&lt;/code&gt;
</description>
		<content:encoded><![CDATA[<p><code><br />
include_once 'inline_function.php';<br />
$nl = '#**!)@#';<br />
$text_with_marked_differences = inline_diff($original_text, $modified_text, $nl);<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

