If you are generating
<meta> description tags automatically (e.g. by including all headings of the document), chances are that you’re extracting it from various sources of content that contain different HTML elements and line breaks in them.
Here is a simple regular expression to remove all line breaks, carriage returns and tabs, and replace them with an empty space.
$text = preg_replace( '/(\r\n)+|\r+|\n+|\t+/i', ' ', $text )
It works by replacing all instances of Windows and unix line breaks and tabs with a blank space character.