Browse By

Best Introduction to PHP What is PHP? 2020

Spread the love
what is php
What is PHP

What is PHP?

What is PHP? PHP (Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It is server side scripting language and most of the websites now a days are developed in PHP or it’s frame works.

 

<?php
    echo "Hi, It's PHP script!";
 ?>

To run PHP script you must have local server it may any server like XAMPP Server, WAMP Server or any server that support PHP engine.

download and install it after installation, you have to hit this url to check server is running or not

http://localhost/ —for server

http://localhost/phpmyadmin –for mysql database server.

Note: before doing this you need to start server by clicking on icon and start then hit the above url in web browser.

Read This Also:

Basics of PHP

Array, Session and Cookies in PHP

What is AJAX and its use with database in PHP?

What is php and why is it needed? Let’s look at this definition.

The first thing to understand is php is just a programming language. That is, with it, we can execute some kind of computer commands, conditions, cycles, and so on …

If so, do it

Do it – for now ….

etc…

That is, some conditions and cycles.

That is, in fact – this is just an ordinary programming language. But the fact is that this php programming language is focused on the development of web applications and websites. This is the so-called server-side programming language or backend. That is, the reverse part of the php language, if you use it for website development and for the purpose of developing some scripts and applications, runs on a remote server on some kind of hosting that supports this web server.

This is where php works.

What does it mean? This means that on the computer of your customers who will visit your site this programming language may not be installed at all. That is, their computers, smartphones, telephones, laptops and so on generally can not understand the php language and be completely unfamiliar with it.

The php language runs on a remote server, which is why it is called the server-side programming language.

Let’s take a look at how this whole circuit works.

For example, a visitor from a laptop decided to visit our site via the Internet. He is accessing our web server. The web server accordingly redirects the corresponding request to the corresponding php script. Next, the php script already interacts with various services. That is, our php language, here it is in this particular file that the client requested through the web server. Php performs a certain set of actions, prepares some kind of web page, gives it to the web server and the web server gives it back to the client who requested this same page.

Thus, the php language is, as it were, a kind of connecting link, core, central processor that performs all automation operations on a remote web server. Checks some conditions. In general, it does everything that makes web programming languages.

And the main advantage of php language is that it is focused on working with web servers. It has a lot of features that allow you to interact with server databases, such as mysql and so on … work with e-mail, mail, work with the file system on a web server.

That is, all these features are built into the php language. There are certain functions that allow you to do this quickly and conveniently. In contrast, if you installed some other programming language on the web server.

Here is such an approximate scheme of work.

But you need to understand that php can be used not only for web servers, but also for creating websites and web applications. We can also use the php language on the command line. That is, by launching the terminal, we can use the php command to run some php file and execute the script that is in it and give some result to the command line in this php file.

That is, the terminal, on the command line, in the operating system that you have installed php, can also be used. We can also use the php language to create the so-called graphical user interface or graphical user interface. That is, it is a normal application for the operating system. That is, the possibilities of the php language are not only websites and web applications. This is also a command line, it is also some kind of graphical application for the operating system.

But most often, in most cases, php is used specifically for creating websites and web applications.

Surely you hear if you were interested in the topic of web development – sites such as wordpress and joomla. But these same engines are written in the php programming language. In addition, facebook is written in php and a site like Wikipedia is also written in php.

That is, it follows from this that, in principle, the capabilities of the php language are quite extensive. And with it, you can create applications of almost any complexity.

So that is all.

I hope you understand more about what php is, and now you can begin to study it in more detail.

History of PHP

Today, the PHP programming language is a powerful tool for developing Web applications. The simplicity of the language, rich features, wide functionality makes it the most popular language among Web developers. In addition, PHP was developed as part of the Open Source project. Therefore, the PHP interpreter is on almost every hosting. PHP is very easy to learn, on the Internet there are various useful libraries in this language, there are many examples of various functions. It’s enough for a beginner PHP programmer to “google” the line “how to … do it in PHP”, and he will surely immediately find a detailed example or a universal library for implementing the required action.

The history of PHP begins in 1994, when programmer enthusiast Rasmus Lerdorf made a set of scripts in Perl. The purpose of this development is to save statistics on views of his resume in html format. Rasmus named his creation Personal Home Page. When the functionality and speed of Perl for its projects began to be lacking, Lerdorf wrote a new interpreter in C. So the first version of the PHP interpreter appeared.

After 3 years, a second version of the PHP interpreter was developed, which was also written in C. The popularity of PHP at that time was extremely low – about 5 tens of thousands of people around the world used it for their development.

The third version of PHP went down in history; it was she who determined the modern style and look of PHP. Recycled by Israeli programmers Andy Gutmans and Zeev Surasky version of PHP 3.0 was officially released in the summer of 1998.

The main advantage of PHP 3.0 is the ability to connect additional modules to the kernel to expand the functionality. PHP is gaining more and more supporters. He supported work with all popular databases. In PHP 3.0, support for multiple protocols and various APIs was possible. The growing popularity of the PHP language has contributed to its rapid development. PHP began to decipher as “hypertext Preprocessor” – a hypertext preprocessor.

In late 1998, Israeli programmers began to develop a new engine. They focused on increasing productivity and improving the modularity of the basis of PHP code. Thanks to the work of the developers, in 1999, an engine called Zend Engine was born, which was a cut above the engine of the previous version of PHP. Based on the Zend Engine, PHP 4.0 was officially released by the year 2000. The new version significantly increased productivity, there were a number of useful innovations. PHP 4.0 has included session support. It is now possible to buffer output. Language has become more secure.

In mid-July 2004, the fifth version of PHP was released. PHP 5 runs on the core of Zend Engine 2, which is much more efficient and productive. A significant moment in the history of PHP was the introduction of full-fledged object-oriented programming in PHP 5, which greatly simplified and made it convenient to develop large-scale projects in the PHP language. Currently, the latest version of the PHP interpreter is version 5.4.

The sixth version has been under development since 2006. But after 4 years, the developers considered it unpromising because of the problems that arose. The fate of PHP 6 is still unknown.

PHP Benefits

The main factor in the PHP language is practicality. PHP should provide the programmer with tools for quickly and efficiently solving assigned tasks. The practical nature of PHP is determined by five important characteristics:

traditionalism;
simplicity;
effectiveness;
security
flexibility.
There is another “characteristic” that makes PHP particularly attractive: it is distributed free of charge! Moreover, with open source codes (Open Source).

Traditional

The PHP language will seem familiar to programmers working in different fields. Many language constructs are borrowed from C, Perl.

The PHP code is very similar to that found in typical C or Pascal programs. This markedly reduces the initial effort in the study of PHP. PHP is a language that combines the advantages of Perl and C and is specifically aimed at working on the Internet, a language with a universal (though with some caveats) and clear syntax.

Simplicity

A PHP script can consist of 10,000 lines or a single line – it all depends on the specifics of your task. You do not have to load libraries, specify special compilation options or anything like that. The PHP mechanism simply begins to execute code after the first escape sequence (). If the code has the correct syntax, it is executed exactly as the programmer pointed out.

PHP is a language that can be embedded directly in the html-code of pages, which, in turn, will be correctly processed by the PHP-interpreter. We can use PHP to write CGI scripts and get rid of many inconvenient text output operators. We can use PHP to generate HTML documents, getting rid of many calls to external scripts.

Efficiency

Efficiency is an extremely important factor when programming for multi-user environments, including the web.

A very important advantage of PHP is its “engine”. The PHP engine is neither a compiler nor an interpreter. He is a translating interpreter. Such a PHP engine engine allows you to process scripts at a fairly high speed.

According to some estimates, most PHP scripts (especially not very large ones) are processed faster than their similar programs written in Perl. However, to prevent PHP developers from doing so, compiled executables will work much faster – tens, and sometimes hundreds of times. But the performance of PHP is quite sufficient to create quite serious web-applications. Details about the device and the characteristics of the “engine” PHP can be found here.

Safety

PHP provides developers and administrators with flexible and effective security tools that can be divided into two categories: system-level tools and application-level tools.

  1. System-level security features

In PHP, security mechanisms are implemented that are managed by administrators; with proper PHP settings, this provides maximum freedom of action and security. PHP can work in the so-called safe mode, which limits the possibilities for users to use PHP in a number of important ways. For example, you can limit the maximum runtime and memory usage (uncontrolled memory consumption negatively affects server performance). Similar to cgi-bin, the administrator can also set restrictions on directories in which the user can view and execute PHP scripts, as well as use PHP scripts to view confidential information on the server (for example, the passwd file).

  1. Application-level security features

The standard set of PHP features includes a number of strong encryption mechanisms. PHP is also compatible with many third-party applications, making it easy to integrate with secure e-commerce technologies. Another advantage is that the source code for PHP scripts cannot be viewed in a browser, because the script is compiled before it is sent at the user’s request. Implementing PHP on the server side prevents the abduction of non-trivial scripts by users who have enough knowledge to at least run the View Source command.

Details on PHP security can be found here.

Flexibility

Since PHP is an embedded language, it is extremely flexible in relation to the needs of the developer. Although PHP is generally recommended for use in conjunction with HTML, it is equally well integrated with JavaScript, WML, XML, and other languages. In addition, well-structured PHP applications expand easily as needed (however, this applies to all major programming languages).

There is no problem with browser dependency either, since PHP scripts are fully compiled on the server side before being sent to the client. In essence, PHP scripts can be transmitted to any browser device, including cell phones, electronic notebooks, pagers, and laptop computers, not to mention traditional PCs. Utility programmers can run PHP in command line mode.

Since PHP does not contain code that targets a specific web server, users are not limited to specific servers (possibly unfamiliar to them). Apache, Microsoft IIS, Netscape Enterprise Server, Stronghold, and Zeus – PHP runs on all of these servers. Since these servers run on different platforms, PHP is generally a platform-independent language and exists on platforms such as UNIX, Solaris, FreeBSD, and Windows 95/98 / NT / 2000 / XP / 2003.

Finally, PHP tools allow the programmer to work with external components, such as Enterprise Java Beans or Win32 COM objects. Thanks to these new features, PHP occupies a worthy place among modern technologies and ensures the scaling of projects to the necessary limits.

So much in PHP

Although programmers like to say bad things about the “preprocessor”, they know how many successful projects took it as a basis. The most popular of them are Facebook and WordPress. You have been familiar with the first for a long time: it is the largest social network in the world. They even released their own translator for a language called HipHop. For Zuckerberg, most likely, the choice was due to the simplicity of the language. Initially, FB was not planned so large-scale, therefore development using the “hypertext preprocessor” seemed like a good idea.

All pages and web applications worked in the language for many years, until the team decided to abandon this. They created a new one to continue supporting the site with its help. But the truth is that even a new language is the same “preprocessor”, with only a few additions. The Hack language is based on PHP, but designed for the needs of Facebook. Most likely, development using a unique language was more of a commercial move than a necessity.

Except that the lazy one knows that PHP is at the core of WordPress. At the same time, the platform itself works fine, especially in new versions. The most curious even know that at one time problems with serialization created a danger for sites made in WP. Some even predicted the collapse of the CMS, but on July 12, 2018, the company released versions where all the problems were fixed. By the way, with the help of the same “preprocessor”.

But the social network and management system may not seem the most weighty evidence of the effectiveness of PHP. We need to bring a web-application that fully works in this language, solves global problems and has commercial success. Well, the e-commerce platform WooCommerce is also fully developed using the “preprocessor”. Almost half of all online purchases in the world pass through it. By the way, their closest competitor – Magento – is also based on PHP.

Why did all these projects and web applications take such a criticized template engine as a basis? More on that later!

Search Tags:– what is PHP, what is PHP used for, what is PHP, what is PHP full from, what is PHP Programming, What is Php language, What is PHP Programming Language, what is PHP advantages, what is PHP explain, what is PHP example, what is PHP tutorial, what is PHP stands for, what is PHP learn, what is PHP in simple terms, what is PHP abbreviation, what is PHP concept, what is PHP code, what is PHP application, what is PHP software, what is PHP development.

2 thoughts on “Best Introduction to PHP What is PHP? 2020”

Leave a Reply

Your email address will not be published. Required fields are marked *