1.什么是PHP?
PHP(“PHP: Hypertext Preprocessor”,超文本预处理器的字母缩写)是一种被广泛应用的开放源代码的多用途脚本语言,它可嵌入到 HTML中,尤其适合 web 开发。
<html> <head> <title>Example</title> </head> <body> <?php echo "Hi, I'm a PHP script!"; ?> </body> </html>
PHP 页面就是 HTML,只不过在其中嵌入了一些代码来做一些事情(在本例中输出了 "Hi, I'm a PHP script!")。PHP 代码被包含在特殊的起始符和结束符 <?php
和 ?>
中,使得可以进出“PHP 模式”。
2.PHP能够干嘛?
服务器脚本
命令行脚本
编写桌面应用程序
使用 PHP,可以自由地选择操作系统和 web 服务器。同时,还可以在开发时选择使用面对过程和面对对象。
PHP有个很强大的特性,支持很大范围的数据库。