浅谈php和.net的区别,浅谈php.net区别
本人最近从asp.net转向了php,主攻方向是Web开发,感觉两者之间还是有不少的区别的。
1.相对于.net,php更偏向于解释性语言类型;
2.在.net中,我们操作的主要是封装好的对象-类库;在php中,我们主要操作的对象主要是各种函数;
3.php的编程工具相对于。net的编程环境和数据库,显得非常非常轻量级;尤其是编程环境,既轻量级还很灵活;
4.在.net和php中,数据传递的方式有get和post(第三种暂时不谈);在.net中,我们获取数据的用的是context.Request["操作对象的ID"]、context.QueryString["操作对象的ID"];在php中,我们获取数据用的是$_get["操作对象的ID"]、$_post["操作对象的ID"];
5.在.net中,显示数据的方式是Response.Write("你要显示的内容");在php中,我们用的是echo "你要显示的内容";
6.在.net中我们操作的主要是对象和数组,两者之间可以相互转化;在.net中,我们操作的对象主要是数组。
这个问题有些模糊 我在多个点解释下
1.运行环境 .NET 是微软的产品 理论上只能在windows 下运行 跨平台很差
PHP 可以再 Windows 和 Linux 上运行 跨平台很好
2.学习成本 PHP 弱类型语言(松散型),简单,容易上手
.NET 我最早是做.NET 的 .NET 学习成本较高 时间较长
3.运行效率 这个仁者见仁智者见智 主要看开发人员的水平了。
不过现在 很多网站 都使用 PHP MYSQL Apache 的组合来开发 因为成本低
学习上:PHP和.NET的学习曲线相比,.NET的学习代价高一些,需要的知识也多一些,不过PHP流行一些学的人也多一些,社区远远多于ASP.NET,所以有难的问题好问些
首先PHP是可以跨平台运行,但是ASP.NET也并不是只能运行在Windows上,很久以前.NET的跨平台版本Mono已经可以稳定的运行在Linux等其它操作系统上了,而且二者都是开源、免费的。
市场方面:以市场份额来说(WEB),现在占有率第一的是传统的ASP、第二是PHP,但ASP.NET也有不少,在企业开发市场方面.NET与Java是均分市场
应用方面:以Alexa前十的网站来看微软官网,Windows Live 、Bing、MSN以及MySpace都是ASP.NET的,当然类似Facebook、WP等网站都是PHP的,但是更多情况下,PHP网站是不会只依赖PHP的,因为PHP虽然Expess,但是没有多线程、面向对象设计也不算全面,所以要依靠其它框架来补充开发,不过也正是如此PHP才有着比.NET更大的开源社区
我学习ASP.NET是因为在.NET下 版本升级很快,而且很锻炼技术,之前的知识可以学以致用,而且我自己感觉这个框架、C#这个语言就是我想要的,很完美,当然,这是在对其它的框架、语言有很多了解之上才决定的。
ASP.NET社区其实比想像中开放很多,微软的官方文档其实允许一般开发者提意见或修改、有调试时也随时可以进入框架本身 的源代码调试。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment