Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 608075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:25:32+00:00 2026-05-13T17:25:32+00:00

I have the following C# code to produce a small PHP file. The reason

  • 0

I have the following C# code to produce a small PHP file. The reason I am doing this is to update 400 plus sites automatically. The sites are in PHP on a Windows Environment so using C# for utility apps is the easiest for me.

fileContents.AppendFormat("<?php{0}",Environment.NewLine);
                fileContents.AppendFormat("# FileName=\"clientsite.php\"{0}",Environment.NewLine);
                fileContents.AppendFormat("# HTTP=\"true\"{0}",Environment.NewLine);
                fileContents.AppendFormat("$clientname = \"{0}\";{1}", clientsiteName, Environment.NewLine);
                fileContents.AppendFormat("$version = \"v6.2i\";{0}",Environment.NewLine);
                fileContents.Append("?>");

The end result of this file causes a strange character to appear on the PHP page that includes this page. When I manually open the created PHP file – press backspace on the last line then enter it works. Is there something better than Environment.NewLine to use for this? Or is there another problem I am missing?

EDIT: The character looks like something I can’t reproduce on the keyboard (squiggle line) by ends with ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:25:32+00:00Added an answer on May 13, 2026 at 5:25 pm

    You could just try “\n”, I believe Environment.NewLine is “\r\n”.

    But it could also be about how you write the StringBuilder (I assume fileContents is a StringBuilder) to the file. If you e.g. use WriteAllText, you could try using different encoding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code txtBlock1.Inlines.Add(This is first paragraph \n This is second paragraph);
The following code samples produce the same error when I perform the SAVEAS: Microsoft.Office.Interop.Excel.Application
I have the following code to send as audio RTP packet some DTMF digits:
I have the following code snippet in my JavaScript patch in quartz composer and
I have the following code: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html
I have two sets of scattered data x y z and x2 y2 z2
I have integers that are supposed to be equal (and I verify it by
Hey guys...I am trying to produce an effect where if I click on a
Could someone here please help me understand how to determine when floating point limitations
I am looking for a way to search multiple columns in a sql table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.