简体   繁体   English

将PHP代码转换为C#

[英]Convert PHP code to C#

Is there a web site or tool that will convert a piece PHP code to C#? 是否有网站或工具将一段PHP代码转换为C#?

something similar to 类似于

http://converter.telerik.com/ http://converter.telerik.com/

or 要么

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

If you love .net, then you may try converting to ASP.net. 如果您喜欢.net,则可以尝试转换为ASP.net。 syntaxes are mostly similar(Argument, guys!! :). 语法大多相似(参数,伙计们!! :)。

Otherwise you may use Phalanger ( http://www.php-compiler.net/doku.php ) 否则,您可以使用Phalangerhttp://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. 在ASP.NET Web服务器上安装此程序可以使您部署PHP代码,甚至可以部署完整的应用程序,如wordpress。

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. PHP被解释(或多或少) ,而C#被编译, 这些语言是完全不相似的 ……这意味着自动化工具可能无法转换所有内容(例如,Facebook的PHP的HipHop将PHP转换为C ++,但不能转换所有内容-例如,它不能转换eval或类似的东西 ,和/或不如聪明的人。

I know this thread was answered already, but I wanted to contribute the PHP to ASP.Net Migration Assistant . 我知道该线程已经得到答复,但是我想将PHP to ASP.Net Migration Assistant贡献PHP to ASP.Net Migration Assistant Its for 1.x, but still usable. 它适用于1.x,但仍然可用。 As mentioned, the difference in the architectures make this kind of automatic conversion an impossibility, but nothing says tools can't help. 如前所述,体系结构的差异使这种自动转换成为不可能,但是没有什么说工具无济于事的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM