How Remove \r\n From String In Php

[Solved] How Remove \r\n From String In Php | Php - Code Explorer | yomemimo.com
Question : how remove \r\n from string in php

Answered by : mohamad-shahkhajeh

$text = preg_replace("/\r|\n/", "", $text);

Source : | Last Update : Sat, 06 Feb 21

Question : php remove newline

Answered by : alberto-peripolli

//Replace the newline and carriage return characters
//using regex and preg_replace.
$text = preg_replace("/\r|\n/", "", $text);

Source : https://thisinterestsme.com/php-remove-newlines/ | Last Update : Wed, 16 Dec 20

Question : string remove line breaks php

Answered by : nice-nightingale-1epbo3z8hqwa

preg_replace( "/\r|\n/", "", $yourString );

Source : https://stackoverflow.com/questions/10757671/how-to-remove-line-breaks-no-characters-from-the-string | Last Update : Mon, 25 May 20

Question : php remove \t and \n

Answered by : annoying-anaconda-8kbjc3nrutmd

$str = preg_replace('/(\v|\s)+/', ' ', $str);

Source : https://stackoverflow.com/questions/7468034/i-tried-to-remove-r-n-t-but-there-are-still-tabs/7468203 | Last Update : Wed, 30 Jun 21

Answers related to how remove \r\n from string in php

Code Explorer Popular Question For Php