In the previous post, you learn to create a simple first program in PHP. Now it is the time to understand the basic syntax of the PHP building block. PHP code needs to be written in <?php ?> block. All statements (instructions) must end with semi-colon (;).
To write comments in PHP you will use // (for single comment) and /* */ (for multiple lines comment). The PHP code block can be placed in the head section or body section of the web page.
<head><title> First PHP Program</title></head>
echo "This is my first program with php."; //php code
/* you need to put your php code in <?php and ?> block . All statements (instructructs) must end with semi-colon(;). */
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: