Php – Strip new lines in PHP

php

I've been working with phrases the past couple of days and the only problem I seem to be facing is stripping new lines in the html before printing it.

Anybody have any idea how to remove every new lines from HTML using PHP?

Best Solution

str_replace(array("\r", "\n"), '', $string)