You can escape characters with addslashes(). When it comes to removing the linebreaks then you could do like this to remove just the linebreaks.
$string = 'this is a string <br> with some<br/> different types<br /> of linebreaks..';
$string = preg_replace('/<br[^>]{0,}>/i', '', $string);
You can also use strip_tags() to remove all html tags in a string.