Jump to content

Outputting Textfile In Right Format For Php


njdubois

Recommended Posts

I'm trying to do a bulk find and replace for about 50 php scripts I've written, so I built a simple vb.net program to do the work. The problem is that when I upload the new files that have been outputted from vb.net, the format of the text is causing issues :

 

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 done a little research on this, and found:

"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.

 

I know this is more a vb.net question, and I have already posted in a correct forum for that as well.

 

Still, any suggestions?

Thanks!

Nick

You still have copies of the original, pre-modified files, right? There are plenty of utilities that will do search/replace in many files. I wouldn't bother with trying to "fix" this issue and instead of getting the end results you need.

 

Here is just such a utility I used many years ago - so I can't comment on it's current viability:

 

http://www.softpedia.com/get/File-managers/Search-and-Replace-98.shtml

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.