.php File — PHP Source Code
text/x-php
Drop any file to identify its extension and type — runs entirely in your browser
Drop a .php file here or click to choose
Or drop any file to identify its extension
text/x-phpQuick Facts
| Extension | .php |
| Full Name | PHP Source Code |
| MIME Type | text/x-php |
| Category | Code |
| Type | Text-based (human-readable) |
| Typical Size | 1 KB – 200 KB |
| First Appeared | 1995 |
What Is a .php File?
PHP (PHP: Hypertext Preprocessor) is a server-side scripting language created by Rasmus Lerdorf in 1994, designed specifically for web development. PHP files contain source code that is executed on the server, generating dynamic HTML content sent to the client's browser. PHP powers an estimated 77% of all websites whose server-side language is known, including WordPress (43% of all websites), Wikipedia, Facebook (via HHVM/Hack), and Drupal. PHP can be embedded directly within HTML using <?php ?> tags, making it straightforward for creating dynamic web pages. The language features dynamic typing, extensive built-in functions for string manipulation, file handling, and database access (especially MySQL/MariaDB), and a mature ecosystem with Composer for dependency management and Packagist as the central package repository. Modern PHP (8.0+) has dramatically improved with features like named arguments, attributes, match expressions, union/intersection types, enums, fibers, and readonly properties. Frameworks like Laravel, Symfony, and Slim provide sophisticated application architectures. Despite historical criticism, PHP's performance has improved dramatically with the JIT compiler in PHP 8.0.
How to Open .php Files
Related File Extensions
More Code File Extensions
Other code formats you might encounter
Browse File Extensions by Category
Explore our reference of 259 file extensions with details, programs, and related formats.