PHP Syntax

A PHP file contains HTML tags and some PHP scripting code. It is very easy to create a simple PHP example. To do so, create a file and write HTML tags + PHP code and save this file with .php extension.

A PHP script starts with <?php  

And ends with ?>

Note: PHP statements ends with semicolon (;).

<?php
// PHP code goes here
?>

<!DOCTYPE html>

<html>

<body>

<h1>My first PHP WEB PAGE</h1>

<?php

echo “Hello World!”;

?>

</body>

</html>

Leave a comment

Your email address will not be published. Required fields are marked *