I. First PHP program
1. Write a file with the suffix named helloworld.php
2. Place the helloworld.php file in the Web server's document root directory
3. Access the helloworld.php file under Web Server management via the browser: http://localhost/helloworld.php
<?phpecho "HelloWorld";? >
4. php files can be written in HTML, CSS, JavaScript and other languages, but the PHP fragment code will be used in the PHP Application server parsing,
The parsed code is sent to the client's browser, the other front-end code is sent directly to the clients, and the client is parsed by the browser.
Two. PHP syntax
1. PHP Language Tags
1.) <?php?> --->>> recommended Use this, if the script ends after?> can not add
2.) <? ?>
3.) <?= $var?>
4.) <%%> --->>> if not, you need to change asp_tags = off in C:/windows/php.ini to on
5.) <script language= "php" > </script>
2. Notes in the program
1.)//single-line comment
2.)/* */multi-line Comment
3.) # Script Comment
4.)/** * * Documentation Comments