Disclaimer: This is a user generated content submitted by a member of the WriteUpCafe Community. The views and writings here reflect that of the author and not of WriteUpCafe. If you have any complaints regarding this post kindly report it to us.

PHP was introduced by  Rasmus Lerdorf in the year 1994, but people started using this year1995, after some time the second version was introduced in the mid-1995 this slowly and steadily PHP started taking its place and was used by 14000-15000 websites in the year 1996. The number of users increased on a continuous basis and in 1997 it reached almost 50000 people and that was the time when PHP3 or PHP version three was introduced. 

PHP is a programming language. This language is generally used for web development. It is popular because of its easy-to-use features. Many web developers also find it easy to learn.

The extension used for this language is .php. When PHP was initially introduced it was called an open-source programming language. 

It is an intermix of numerous databases like:

  1. MySQL

  2.  PostgreSQL

  3. Oracle

  4. Sybase

  5. Informix 

  6.  Microsoft SQL Server.

PHP is also used to execute some basic system functions, manage data and record fines, delete data, data sending via emails, it is also used to ciphertext. 

Let us begin with a simple illustration of the PHP scripting language.

<html>

   

   <head>

      <title>Hello World</title>

   </head>

   

   <body>

      <?php echo “Hello, World!”;

$color = “red”;

Echo “My car is ” . $color . “<br>”;

ECHO “My house is ” . $COLOR . “<br>”;

echo “My boat is ” . $coLOR . “<br>”;?>

   </body>

</html>

It will show the output as 

Hello, world!

BASIC SYNTAX USED IN PHP

Php is a sub structure of HTML, wordpress, XML, MVC,CMS 

In the above example of PHP 

      <?php echo “Hello, World!”;?>

The php codes commence with <?php

And terminate with ?>

Here the echo code is used to disclose the output on the webpage 

You can use this code as:

Echo

ECHO

echo 

They all will work fine. 

PHP variables start with $ sign and terminate with ; sign 

 These are some basic syntax used in the PHP language.

Variables in PHP 

  1. These variables are used as a vessel for containing data.

  2. Variable used this $ sign for the commencement and went around with the variable name. 

  3. Variable scope- it is that part of language which shows where to use these variables.

              These scopes are divided into three categories namely:

  •  Local – is placed inside the function and only be ingressed there.

  • Global – is placed outside the function and only be ingressed there. 

  •  Static – on the completion of a function some variables disappear on their own and if you don’t want them to disappear then we use static at the starting of that variable.

  Constants in PHP  

  • Constants in PHP are the same except for one thing that once placed it cannot be swapped. 

  • Constants use letters or underscore.

  • Generate PHP constant: for this, we use the define() sign, which contains value, name, and case sensitivity. 

  • Constant array: it can contain numerous terms.

  • Global constant: they can be used anywhere in the program.

Wind up:

 In the above article, you will get to read about the PHP language and some of its basic syntaxes used in the PHP language. If you want to learn the PHP language then here is a notable opportunity for you. You can learn the PHP language from experts at the dzone training institutions. You will proper guidance about everything for more information you can visit our site    https://traininginstituteinjaipur.net/

Login

Welcome to WriteUpCafe Community

Join our community to engage with fellow bloggers and increase the visibility of your blog.
Join WriteUpCafe