outputting textfile in right format for PHP

NJDubois

Well-known member
Joined
May 15, 2008
Messages
84
Programming Experience
Beginner
I'm trying to do a bulk find and replace for about 50 php scripts I've written. The problem is that when I upload the new files, the format of the text is causing issues and if you know anything about php, this is the error I'm getting :

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent

the first 2 lines of the php script look like this:

<?php
session_start();

If I open the file in win_scp, delete the new line after php, and hit enter. Save the file, and it works fine.

I've don't a little research on this, and found this:
"encoding file type is UTF-8 without BOM."

How do I get my.computer.filesystem.writealltext(file,append, ENCODING)
to output files in that format?

My.Computer.FileSystem.WriteAllText(fi.Name, file_text, False, Encoding.UTF8)
isn't working. I still get the header errors from the php.

Any suggestions?
Thanks!
Nick
 
IO.File.WriteAllText where you don't specify encoding will output as UTF-8 without BOM.
 
Back
Top