PHP Basic Syntax

A PHP code starts with "<?php" and ends with "?>"

It can be placed anywhere in between the file/document.

For Example:


//Your Code here


So a basic hello world code would look like:


    echo "hello world";


A php file will be saved with a ".php" extension. 

Normally a php file contains Html, CSS and  php scripting code.

In simple language, HTML and CSS is the design what we see on the web browser. PHP code is responsible for carrying out tasks such as storing and retrieving the data in and from database, performing many other tasks which we will discuss in the further chapters.


<p>Hello world in HTML</p>

echo "Hello World in PHP";


Not Case Sensitive

PHP is not a Case Sensitive language which means any inbuilt functions or user defined funtions can be written and called in upper case or lower case.

    echo "hello";
    ECHO "hello";
    eCho "hello";
    eCHO "hello";

All the above statements are correct, as PHP is not a case sensitive language.