tags:

views:

111

answers:

3

Is there a web site or tool that will convert a piece PHP code to C#?

something similar to

http://converter.telerik.com/

or

http://www.developerfusion.com/tools/convert/csharp-to-vb/

+1  A: 

I don't know any such tool -- and I'd suppose that any automated tool to do that kind of "conversion" between two languages that are quite different would not do such a good job...

PHP being interpreted (well, more or less), and C# being compiled, those languages are quite not similar... Which means an automated tool will probably not be able to convert everything (as an example, Facebook's HipHop for PHP converts PHP to C++, but cannot convert everything -- it cannot convert eval and such things, for example), and/or will not be as good as an intelligent human-being.

Pascal MARTIN
+1  A: 

If you love .net, then you may try converting to ASP.net. syntaxes are mostly similar(Argument, guys!! :).

Otherwise you may use Phalanger(http://www.php-compiler.net/doku.php )

Installing this on your ASP.NET web server allows you to deploy PHP code, even full applications like wordpress.

rwik
I came across Phalanger on my travels and hoped they had a page to do the conversion, but sadly no :-(
Rob
A: 

I know this thread was answered already, but I wanted to contribute the PHP to ASP.Net Migration Assistant. Its for 1.x, but still usable. As mentioned, the difference in the architectures make this kind of automatic conversion an impossibility, but nothing says tools can't help.

Laramie