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