php str_replace new lines from file code example Example: remove line break html php preg_replace( "/\r|\n/", "", $yourString );