It might be a bit hacky but I would try just using a str_replace() to get rid of any line-breaks.
$titleStripped = str_replace('\n', ' ', $title);
$pieces - explode(' ', $title);
Depends on your application and expected data though. If you're expecting more than line breaks, go with a preg_replace. Either way, prep the data before exploding.