Sunday, July 23, 2017

PHP Syntax

PHP is a server side scripting language, So PHP script is executed on the server when user load the webpage and return the result back to browser as a plain HTML.

Before writing the php script we need to remember the below few things:

1. A PHP script can be placed anywhere in the document.
2. A PHP script starts with <?php and ends with ?> .
3. To see the result of php code in browser, you need to save the file consists of php code as ".php" extension. eg. [Demo.php]
4. PHP statements end with a semicolon (;).


// write the PHP code goes here

PHP file consists of HTML tags and php scripts. Look below for sample PHP code :

<!DOCTYPE html>

<h1>Welcome to first PHP page</h1>

echo "Hello Skptricks";


No comments:

Post a Comment