Ok, Im really stuck here.
Heres what Ive got from the top.
A textarea used for entering text into a database.
Im using $text=nl2br($text); along with $text=addslashes($text); before insertion to maintian line breaks etc.
Ive constructed a search engine (too big to display here) which works fine, it displays the text exactly as it went in.
Finally, Im building abstracts from the text using the sentence containing the search parameter and displaying those sentences to the user.
If(($value!=="")&&($search=="")){echo "<strong>Extract:</strong><br>\n";echo $solution;}
else{
echo "<strong>Abstract:</strong><br>\n";
$newsolution=explode("." , $solution);
$n=count($newsolution);
for ($p=0; $p<$n-1;$p++)
{
$k=sizeof($rush);
//echo $k;
for($x=1; $x<count($rush); $x++)
{
if(ereg("^\\+", $rush))
{
$rush = ereg_replace("^\\+", "", $rush);
}
elseif(ereg("^\\-", $rush))
{
$rush = ereg_replace("^\\-", "", $rush);
}
if (eregi("($rush[$x])", $newsolution[$p])) {$mssg=$newsolution[$p].".".$mssg;}
}
}
$mssg=explode(".", $mssg);
$mssg=array_unique($mssg);
reset($mssg);
//sort($mssg);
for ($y=0;$y<count($mssg);$y++)
{
$nmssg=$nmssg . "....." . $mssg[$y];
$nmssg=explode(".....", $nmssg);
$nmssg=array_unique($nmssg);
$nmssg=implode(".....", $nmssg);
}
if(!($nmssg)){echo $solution;}
else{
echo $nmssg;
}
unset($nmssg);unset($mssg);
}
This last bit works but I cant find a way to remove line breaks ect..
for example...
this is line one.
this is line two.
should be ..
this is line one.
this is line two.
ive tried eregi_replace() with \n\r
and ive tried to the html version but no success any ideas any one?