macinslaw Posted August 2, 2007 Share Posted August 2, 2007 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 https://forums.phpfreaks.com/topic/63075-solved-how-to-write-a-carriage-return-line-feed-to-file-with-php/ Share on other sites More sharing options...
effigy Posted August 2, 2007 Share Posted August 2, 2007 echo "\r\n"; Link to comment https://forums.phpfreaks.com/topic/63075-solved-how-to-write-a-carriage-return-line-feed-to-file-with-php/#findComment-314133 Share on other sites More sharing options...
macinslaw Posted August 2, 2007 Author Share Posted August 2, 2007 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 https://forums.phpfreaks.com/topic/63075-solved-how-to-write-a-carriage-return-line-feed-to-file-with-php/#findComment-314259 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.