Breaking News

What is php ?


mural that says 'What is php' in front of person searching for what is php



PHP is a popular general-purpose scripting language originally created by Rasmus Lerdorf in 1994 who wrote several Common Gateway Interface (CGI) programs in C, which he used to maintain his personal homepage. The PHP reference implementation is now produced by The PHP Group.The fact that PHP was not originally designed, but instead was developed organically has led to inconsistent naming of functions and inconsistent ordering of their parameters.

  • PHP is a widely-used, open source scripting language
  • PHP scripts are executed on the server
  • PHP is an acronym for "PHP: Hypertext Preprocessor"
  • PHP is free to download and use




Now Let's Try to understand this with an example :


Example :  Hello World


<!DOCTYPE html>
<html>
 <head>
  <title>PHP "Hello, World!" program</title>
 </head>
 <body>
  <?php echo '<p>Hello, World!</p>'; ?>
 </body>
</html>


As we are all familier with the basic working as well as the structure of HTML but instead of lots of commands to output HTML. PHP pages contain HTML with embedded code that does "something" (in this case, output "Hello World, I'm a PHP script!"). The PHP code is enclosed in special start and end processing instructions <?php and ?> which allows you to jump into and out of "PHP mode."

The best thing about PHP is that it is extremely simple which makes it easy for a newcomer to grasp and understand this Language at much faster pase than some of the other languages, but it also offers many advanced features for a professional programmers too.

What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server, generating HTML which is then sent to the client. The client would receive the results of running that script, but would not know what the underlying code was. You can even configure your web server to process all your HTML files with PHP, and then there's really no way that users can tell what you have up your sleeve. 

Although PHP's development is focused on server-side scripting, you can do much more with it.


Data Types

PHP stores integers in a platform-dependent range, either as a 32, 64 or 128-bit signed integer.Floating point numbers are also stored in a platform-specific range although they can be specified using floating point notation.PHP has a native Boolean type that is similar to the native Boolean types in Java and C++.The null data type represents a variable that has no value. NULL is the only allowed value for this data type.Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays.


Functions

PHP defines a large array of functions in the core language and many are also available in various extensions such as  " User-defined functions " ,  " Variable functions " ,  " create_function( ) " and  " Anonymous functions ".

PHP Objects

In some of the previous versions of PHP, objects were handled like value types which led to the  drawback that the code had to make heavy use of PHP's "reference" variables if it wanted to modify or alter an object it was then passed rather than creating a copy of it. In the new approach, objects are referenced by handle, and not by value However later on PHP 5 introduced private and protected member variables and methods, along with abstract methods, abstract classes, final classes,  and final methods. It also introduced a standard way of declaring constructors and destructors, similar to that of other object-oriented languages such as C++, and a standard exception handling model.

For more info on History of PHP check out our History of PHP Page. 



Conclusion 

    1.  PHP is a popular general-purpose scripting language
    2.  It was originally created by Rasmus Lerdorf in 1994.
    3.  PHP scripts are executed on the server 
    4.  PHP supports integers,Floating point numbers,native Boolean type,null data type and Arrays which can contain elements of any type such as resources, objects, and even other arrays.
    5.  PHP defines a large array of functions available in various extensions such as  " User-defined functions " ,  " Variable functions " ,  " create_function( ) " and  " Anonymous functions ".
    6.  The previous versions of PHP, objects were handled like value types which led to the heavy use of PHP's "reference" variables but PHP 5 introduced private and protected member variables and methods, along with abstract methods, abstract classes, final classes,  and final methods which solved this problem.
    7. Also PHP is extremely simple which makes it easy for a newcomer to grasp and understand.

So this is it guys if you want us to write more on this topic or have any particular query regarding this post you can always comment or feel free to mail us at our official mail also follow us on Instagram and Facebook to receive Latest Updates first.

PEACE!!!




References :


> W3Schools.com

PHP.net

Wikipedia.org


No comments

If you have any doubts, please let us Know.