The PHP instruction separation is semicolon(;).
As in any another programming language, every instructions to be terminated with a semicolon(;).
Same in PHP also requires instructions to be end with semicolon at the end of each statement.
The closing tag of a block of PHP code automatically implies a semicolon(;).
You do not need to have a semicolon terminating the last line of a PHP block.
For example:
1 2 3 4 |
<?php echo "Hello world"; echo "Welcome"; ?> |
Output:
1 2 |
Hello world Welcome |
It is not necessary to give semicolon after a echo statement if your script contain only one instruction.
For example:
1 |
<?php echo 'Welcome in webencyclop PHP tutorial' ?> |