Contact US


Get Your Project Done by our experts
info@fundaofwebit.com

PHP Basic Syntax

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

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

For Example:

<?php

//Your Code here

?>


So a basic hello world code would look like:

<?php

    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.

<html>
<body>

<p>Hello world in HTML</p>

<?php
echo "Hello World in PHP";
?>

</body>
</html>


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.

<?php
    echo "hello";
    ECHO "hello";
    eCho "hello";
    eCHO "hello";
?>


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