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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.