Php Syntax


A PHP scripting block always starts with . A PHP scripting block can be set anyplace in the document.

On servers with shorthand help empowered you can begin scripting block with <? and end with ?>.

However, for maximum compatibility, we suggest that you utilize the standard structure as opposed to the shorthand structure.

<?php 
//code to be excuted 
?>

 

A PHP document file ordinarily contains HTML tags, the same as an HTML file, and some PHP scripting code.

below, we have a case of a simple PHP content that sends the content “Hi World” to the browser.

<html> 
<body> 
    <?php echo "Hello World"; ?> 
</body> 
</html>

Each code line in PHP must end with a semicolon. The semicolon is a separator and is utilized to recognize one lot of instructions from another.

There are two essential proclamations to output content with PHP: echo and print. In the example above we have utilized the reverberation explanation to output the content “Hello World”.