Is there a web site or tool that will convert a piece PHP code to C#?
something similar to
or
Is there a web site or tool that will convert a piece PHP code to C#?
something similar to
or
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.
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.
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.