0

I have read php to C# converter, but it is a little bit unclear to me.

My questions

  1. Not all of the PHP functions are avialable in C#. But if I have a piece of PHP code and I have to have it in C#, do I have to create those functions myselfs?
  2. What is the difference between convert and compile?
  3. Maybe there is a library in C# that can run PHP files and return the data? (As AJAX: PHP to JavaScript)

The first answer, learn C#, this takes a lot of time so it's not working for me short term. And the second, someone who can convert it, are hopefully you?

Basically, ...

... I have one file of PHP and I want to convert that to C# so I can use it in a C# project. The file looks like this Github file.

Thank you!

(I'm a PHP web developer and don't have much experience in C#.)

Community
  • 1
  • 1
Dirk Jan
  • 2,355
  • 3
  • 20
  • 38
  • You would need to use another site to hire someone to convert your code for you - for the most part most code conversions are fairly straight forward - if you dont wish to learn c# why are you going to do a c# project? – BugFinder Mar 01 '16 at 11:37
  • @BugFinder, I would like to learn C# but you can't learn it in two weeks or so.. But my project on the other hand is short term;) – Dirk Jan Mar 01 '16 at 11:40
  • As someone who codes in php, so, Id expect you would be able to get most of the fundemental basics in a working day.There are a lot of c#' examples out there to help you with c# functions, just like the php functions have. just not always in the same place. – BugFinder Mar 01 '16 at 11:46

1 Answers1

3

PHP and c# are both languages. There will be similarities, but they are definitely not interchangeable. That said, let's answer your questions:

  1. No and yes. As I said, the languages differ. They may look the same, but they are not. Luckily they are quite mature and a number of functions will be on both sides, probably with different names and syntax though.

  2. In this context, convert will change code in another language, but still on the same 'level' and compile will change the code into something the computer understands.

  3. Probably not, although there might be. I do advice against this btw.

You should learn some c# to get this done, at least as much needed to convert the php to c#. From the question it looks you will be doing more c# after converting this, so why not start now?

dmaij
  • 1,017
  • 7
  • 15