Welcome to Our Free Tutorial!

PHP-Use of Semi-colon!

Previous Home Next

As you have noticed that we use semicolon (;) at the end of the each line of PHP code, this tells the server the PHP statement has finished.
As you may do one thing in the previous examples, there was the use of semi–colon end of the line. This specify the end of the statement, If we repeat “Hello Simple PHP!” as several times then what will output.

Example

<html>
<head>
<title>PHP Syntax Example</title>
</head>
<body>
<h2>Welcome to the aonestudy PHP </h2>
<?php
  echo "Hello Simple PHP!";
  echo "Hello Simple PHP!";
  echo "Hello Simple PHP!";
  echo "Hello Simple PHP!";
  echo "Hello Simple PHP!";
?>
</body>
</html>

Output:-

Semi colon

White space

As you have heard about white-space, white-space is ignored between PHP statement. You can press tab to 15 lines of blank space before the next line of PHP code. PHP ignore those spaces.

Example:-

<body>
<h2>Welcome to the aonestudy PHP </h2>
<?php
  echo "Hello Simple PHP!";
........
    ....
       echo "Hello Simple PHP!"; 
?>
</body>
Previous Home Next