PHP
PHP (noun) means a programming language that runs on a web server to build pages before they are sent to the visitor, commonly used for websites that draw their content from a database. Example: “The whole site is a few thousand lines of PHP talking to a database.”
How to Use PHP
Learner’s notesIn plain EnglishPHP is code that runs on a website's server to build each page before you see it.
Always the initialism in practice; the expanded name appears mainly in documentation. Files carry the .php extension.
PHP runs on the server, so visitors never see the code itself — only the finished HTML it produces. This is the opposite of JavaScript running in the browser, which the visitor's device executes.
Trace the full origin ↓Fill the Gap
Can you complete this real example?
The whole site is a few thousand lines of _____ talking to a database.
Etymology
Originally an initialism of Personal Home Page Tools; the name was later redefined as the recursive expansion PHP: Hypertext Preprocessor.
Synonyms
View more →Frequently Asked Questions
What is the difference between PHP and JavaScript?
PHP traditionally runs on the server and produces the page that gets sent out; JavaScript runs in the visitor's browser and changes the page after it arrives. JavaScript can also run on servers nowadays, but the browser remains its home ground.
Is PHP still used?
Yes. It powers a large share of existing websites, including the content management systems many sites are built on, and it continues to receive new versions and language features.
Do you need PHP to make a website?
No. A site can be plain HTML and CSS with no server-side language at all. PHP becomes relevant when pages need to be assembled from stored data, handle logins or process form submissions on the server.