PHP Predefined Variables Example

Server Name: shbrema.soisweb.uwm.edu

User Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)

Predefined variables in PHP are variables that are automatically accessible for usage without the need to declare or initialize them. These variables include information about the server, user, and environment in which the script is operating.

Two commonly used predefined variables are:

For example, you can access the server name using $_SERVER['SERVER_NAME'] and the user agent string using $_SERVER['HTTP_USER_AGENT'].