njdubois Posted December 14, 2012 Share Posted December 14, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/272002-outputting-textfile-in-right-format-for-php/ Share on other sites More sharing options...
Psycho Posted December 14, 2012 Share Posted December 14, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/272002-outputting-textfile-in-right-format-for-php/#findComment-1399425 Share on other sites More sharing options...
Stooney Posted December 14, 2012 Share Posted December 14, 2012 Notepad++ can do a 'replace all' in multiple files at a time. Quote Link to comment https://forums.phpfreaks.com/topic/272002-outputting-textfile-in-right-format-for-php/#findComment-1399433 Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2012 Share Posted December 14, 2012 If your files don't contain any UTF-8 encoded characters, you would want to use/try ASCII encoding. Quote Link to comment https://forums.phpfreaks.com/topic/272002-outputting-textfile-in-right-format-for-php/#findComment-1399438 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.