You can create PHP files without any html tags and that is called Pure PHP file. The server interprets the PHP code and outputs the results as HTML code to the web browsers. In order for the server to identify the PHP code from the HTML code, we must always enclose the PHP code in PHP tags. A PHP tag starts with the less than symbol followed by the question mark and then the words “php”. PHP is a case sensitive language, “VAR” is not the same as “var”.
The PHP tags themselves are not case-sensitive, but it is strongly recommended that we use lower case letter. The code below illustrates the above point.
<?php … ?>
PHP Hello world
The program shown below is a basic PHP application that outputs the words “Hello World!” When viewed in a web browser.
<?php
echo "Hello world";
?>
Output:
Hello world
0 Comments