PHP Syntax

A PHP script starts with "<?php" and ends with "?>" and all the PHP code goes between this php tag. For example :
<?php
  //  php code goes here
?>
The PHP script can be embedded within HTML web pages and it can be placed anywhere in the document. The default extension for PHP files is ".php". The php statements ends with a semi-colon ( ; ) sign. For example :
<html>
<body>
  <?php
    echo "<p>Hello world, This is a Test Page.</p>";
  ?>
</body>
</html>
Output :

Hello world, This is a Test Page.

Case Sensitivity in PHP :

In php only variable names are case-sensitive. It means all keywords(if, else, while, for, echo print etc.), classes, functions, user-defined functions are not case sensitive. For example, at below code, we write the echo function is different cases :
<html>
<body>
  <?php
    echo "<p>Hello world, This is a Test Page.</p>";
    ECHO "<p>Hello world, This is a Test Page.</p>";
    EcHo "<p>Hello world, This is a Test Page.</p>";
  ?>
</body>
</html>
Output :

Hello world, This is a Test Page.
Hello world, This is a Test Page.
Hello world, This is a Test Page.

And now in the next example we define a variable and then try to access it by changing is letters case :
<html>
<body>
  <?php
    $myvar = "Hello world";
    echo $myVar;
  ?>
</body>
</html>
Output :

Hello world

And as we can see that in output the error message is shown, because within the echo function we use the name $myVar, where the V is capital.

Next Topic :