The basic syntax of the PHP Tutorial. PHP script block? Php starts? End. You can place PHP script blocks anywhere in the document. Of course, on servers that support abbreviations, can you use? And? To use the PHP script block End. You can place PHP script blocks anywhere in the document.
Of course, you can use To start and end the script block.
However, we recommend that you use the standard format (
The code is as follows:
?>
PHP files usually contain HTML tags, like an HTML file and some PHP script code.
Below, we provide a simple PHP script, which can output the text "Hello World" to the browser ":
The code is as follows:
Echo "this is PHP Tutorial network! ";
?>
Each line of code in PHP must end with a semicolon. A semicolon is a separator used to differentiate the instruction set.
There are two basic commands for outputting text through PHP: echo and print. In the above example, we use the echo statement to output the text.
Comments in PHP
In PHP, we use // to write single-line comments, or use/* and */to write large comments.
The code is as follows:
// This is a comment
/*
This is a big comment,
Comment multiple lines
*/
Echo "test string1 ";
Echo"
"; // Add here"
"Is to generate a new line on the Web page, that is, line feed.
Echo"
";
// Echo "test string2
";
// Echo "test string3
";
Echo "test string4
";
?>
Http://www.bkjia.com/PHPjc/320763.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/320763.htmlTechArticlePHP script block? Php starts? End. You can place PHP script blocks anywhere in the document. Of course, on servers that support abbreviations, can you use? And? Come...