PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
A PHP script is executed on the server, and the plain HTML result is sent back to the browser.
// This is a single-line comment
# This is also a single-line comment
/*
This is a multiple-lines
comment block
*/
PHP has no command for declaring a variable.
Global and Local Scope:
<?php
$x = 5;
$y = 10;
function myTest1() {
global $x, $y;
$y = $x + $y;
}
function myTest2() {
$GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y'];
}
?>
在htdocs文件夹里需要新建文件夹和project name一样
然后再新建一个index.php文件就可以直接在浏览器通过Apache运行.php文件了