PHP Predefined Variables

Example 1: SERVER_SOFTWARE

Server Software: Apache

Example 2: REQUEST_METHOD

Request Method: GET

What Each One Means

SERVER_SOFTWARE: This provides information about the web server software that is running the PHP page.

REQUEST_METHOD: This tells us which request method was used to access the page, such as GET or POST.

Explanation

Predefined variables are special variables that PHP automatically makes available to a script. They can provide information about the server, browser request, forms, cookies, sessions, and other data. The $_SERVER variable contains information about the server and the current request, so programmers can use this information without creating it manually.

Back to Activity 3 Home