PHP is an open source general-purpose scripting language that is especially suited for web development. It was created by Danish Canadian programmer Rasmus Lerdorf in 1994. PHP now stands for Hypertext Preprocessor.
According to Wikipedia PHP code is usually processed on a web server by a PHP interpreter implemented as a module, a daemon or as a Common Gateway Interface (CGI) executable. On a web server, the result of the interpreted and executed PHP code – which may be any type of data, such as generated HTML or binary image data – would form the whole or part of an HTTP response. Various web template systems, web content management systems, and web frameworks exist which can be employed to orchestrate or facilitate the generation of that response. Additionally, PHP can be used for many programming tasks outside the web context, such as standalone graphical applications and robotic drone control. PHP code can also be directly executed from the command line.
A session is a mechanism to store information (in variables) to be used across several pages at once.
An application is opened, modified and closed when a user works on it. The user is recognized by the computer. It is aware of when you open and close the application. On the internet, however, there is a problem: because HTTP addresses don't keep state, the web server does not know who you are or what you do.
This problem is solved by session variables by storing user information for usage on various pages. The session variables last until the user closes the browser.
A PHP file is a plain-text file that contains code created using the PHP programming language. The PHP code is performed on the server because PHP is a server-side (back-end) scripting language.
All PHP code is converted to HTML on the web server by the PHP engine, hence the resulting web pages contains only HTML code when the code is sent to the client side. Since the server has already run the PHP code and converted it to HTML, you will never see the original PHP code while viewing the source of any PHP file in a browser.
A sort of data structure in PHP called an array allows us to store multiple elements of the same type under a single variable, saving us the time and effort of having to establish a separate variable for each piece of information.
The arrays are helpful to create a list of elements of similar types, which are accessed using their index or key.