php remove all types \n from string code example Example: how remove \r\n from string in php $text = preg_replace("/\r|\n/", "", $text);