How To Use PHP Syntax

In this article I am going to explain use PHP Syntax.
  • 2103

Use PHP Syntax

PHP script is start <?php and ends with ?>.It is use anywhere.

On servers with shorthand-support, we can start a PHP script with <? and end with ?>.

PHP is used .php extension.

A php file contains HTML Tag.

Syntax

<?php

?>

 

Example

 

<html>
<body>

<?php
echo "Welcome in DotNetHeaven";
?>
</body>
</html>

 

Define a code

 

PHP must end code line with a semicolon.


There are two basic statements to output text with PHP: echo and print.

we have used the echo statement to output the text "Welcome in DotNetHeaven".

 

PHP comments

 

<html>
<body>

<?php
//PHP comments
/*
This is
a comment
block in PHP
*/
?>
</body>
</html>

 

Further Readings

You may also want to read these related articles :here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.