Jump to content

compare two text and echo diffrence


fer0an

Recommended Posts

$text1 = <div class="center"><b>X-Men Forever 2 #3</b><br/>
English | 1280 x 2000 | CBR | 24.5 MB</div><br/>
<br/>
MU<br/>
<a href="http://www.megaupload.com/?d=DCK1Q2KN" target="_blank" rel="nofollow">Download</a><br/>
<br/>
<b><div class="center"><a href="http://avaxhome.ws/blogs/olyr82" target="_blank" rel="nofollow">>>Visit my blog<<</a><br/>
<br/>
or<br/>

<br/>
<a href="http://www.website.ws/olyr82/rss.xml" target="_blank" rel="nofollow">>>Subscribe to my blog here<<</a><br/>
<br/>
for many more tv shows.</div></b> <br/>
<br/>
<b>No mirrors.</b>
</div>
<table class='file-express' width='100%'>
<tr>
<td style='text-align: left; color: #B2AC94; font-size: 3'>File exists.dllinktitletm=  <font color='red' >X-Men Forever 2 #3  : found</font><br><font color='red' ><b>no2</b></font>X-Men Forever 2 #3 8043text added

$text2 = <div class="center"><b>X-Men Forever 2 #3</b><br/>
English | 1280 x 2000 | CBR | 24.5 MB</div><br/>
<br/>
MU<br/>
<a href="http://www.megaupload.com/?d=DCK1Q2KN" target="_blank" rel="nofollow">Download</a><br/>
<br/>

Right... if I understand correctly, you want something like:

 

$text1 = 'This is my wonderful piece of text';

$text2 = 'This is my wonderful';

$output = str_replace($text2, "", $text1);

echo $output; 

 

$output will therefore equal " piece of text", thus removing text 2 from text 1... so $output would be the "difference" I suppose.

 

Is this what you are trying to do?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.