.php
💻 CodeText-based

.php File — PHP Source Code

text/x-php

File Inspector

Drop any file to identify its extension and type — runs entirely in your browser

PHP

Drop a .php file here or click to choose

Or drop any file to identify its extension

Expected MIME type:text/x-php

Quick Facts

Extension.php
Full NamePHP Source Code
MIME Typetext/x-php
CategoryCode
TypeText-based (human-readable)
Typical Size1 KB – 200 KB
First Appeared1995

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

VS Code
PhpStorm
Sublime Text
vim
Emacs
any text editor

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.