All PHP code goes between the php tag. It starts with <?php and ends with ?>. 

  • The php file default file extension  is “.php”
  • File save with .php file extension
  • Every PHP statement end with a semicolon (;) 

PHP tag Syntax  given below:

<?php echo "Hello Tutorialsonweb!"; ?>  

Output:

Hello Tutorialsonweb!

Embedding PHP within HTML-

PHP with HTML tag

 <h1><?php echo "Hello, Tutorialsonweb!"; ?></h1>

Output:

Hello, Tutorialsonweb!