What is PHP?
Learn that PHP is a server-side language and how it differs from the browser.
What is PHP?
PHP is a server-side programming language. It was designed to make websites dynamic.
When a browser requests a PHP page, the server runs the PHP code and produces HTML. The browser never sees the PHP code; it only displays the resulting HTML.
PHP was created by Rasmus Lerdorf in 1994 and is now a modern language at version 8.3. WordPress, Wikipedia and millions of sites run on PHP.
Where does PHP run?
PHP code runs on the server. You upload a PHP file to the server; when a visitor requests the page, the server executes the code.
The server sends the result to the browser as HTML. When the visitor views the page source, they see HTML tags, not PHP commands.
This makes PHP secure: sensitive data like a database password never reaches the browser.
Test yourself
-
Which one is a server-side language?
- CSS
- PHP
- HTML
- XML
Show answer
PHP — Correct! PHP runs on the server side.
-
PHP, browser and HTML
- PHP
- Server
- Browser
- Client
- HTML
- Output
-
Which can be done with PHP?
- Animate in the browser
- Change the CSS layout
- Process form data
- Set a button color
Show answer
Process form data — Correct! PHP processes form data on the server.
-
Where does PHP run?
PHP runs on the ____.Show answer
PHP runs on the server.