I'm trying to convert ^M character to a white space character, but having hard time doing this.
In PHP, I used "wb" option so, it wouldn't write DOS character into the file. fopen("file.csv", "wb") It was successful, but still has line breaks instead of ^M
$fp = fopen("file.csv", "wb");
$description =nl2br( $product->getShortDescription());
$line .= $description . $other_variables . "
";
fputs($fp, $line);
but I still see line break within the description, is there any way to remove ^M and replace it with possibly a whitespace.
Also used dos2unix, when it was in regular file "w" mode. It removes all ^M characters, but the file still has line breaks where there was ^M. I really need it to be all on one line for my CSV file to work.
Thank you.