PHP's script block to End. You can place the PHP script block anywhere in the document.
Of course, on a server that supports shorthand, you can use the To start and end the script block.
However, in order to achieve the best compatibility, we recommend that you use the standard form (
Copy the Code code as follows:
?>
PHP files usually contain HTML tags, like an HTML file, and some PHP script code.
Below, we provide a simple PHP script that can output the text "Hello World" to the browser:
Copy the Code code as follows:
echo "This is PHP tutorial net!";
?>
Each line of code in PHP must end with a semicolon. A semicolon is a delimiter used to differentiate the instruction set.
There are two basic instructions for outputting text through PHP: Echo and print. In the example above, we used 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 comment blocks.
Copy the Code code as follows:
This is a comment
/*
This is the big note,
Can annotate multiple lines
*/
echo "Test string1";
echo "
"; Here to add "
"is to generate a new line on a Web page, that is, a newline
echo "
";
echo "Test string2
";
echo "Test String3
";
echo "Test String4
";
?>
The above describes the PHP tutorial download PHP tutorial Basic syntax, including the PHP tutorial download content, I hope to be interested in PHP tutorial friends helpful.