Jump to content

[SOLVED] how to write a Carriage Return + Line Feed to file with PHP


macinslaw

Recommended Posts

I have some results of many sql statements being written to a file for use by a third party software.  The software cannot use the "\n" end of line, instead the require a Carriage Return + Line Feed for windows.  Can anyone tell me the method by whih to do so?

 

An example is below:

<?
$m = "something[1,1]\t$something\n";
$data .= $m;
$data= str_replace('"', "", $data);
    fwrite($fp,$data);    //    Write information to the file
    fclose($fp);  //    Close the file
    echo "File Created Successfully";
} else {
    echo "Error saving file!";
}
?>

Thanks

-Mac

Thanks, I have tried this and am not certain whether it will fit the bill, are there other ways to produce a windows carriage return?

 

I will mark this as resolved until I hear back from the testing center where the file was sent.

 

Thanks for the help!

 

-Mac

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.