PHP is a server-side scripting language used mainly to build dynamic websites and web applications.
PHP stands for PHP: Hypertext Preprocessor. It is a widely-used, open-source, server-side scripting language primarily designed for web development to create dynamic, interactive pages. Originally, PHP stood for “Personal Home Page” when it was created in 1994, but it was later changed to reflect its evolution.
What PHP actually does
PHP runs on the server, not in the browser.
When someone visits a website:
- The browser sends a request to the server
- PHP code runs on the server
- PHP generates HTML (and sometimes JSON, etc.)
- The server sends the result back to the browser
The user never sees the PHP code—only the output.
What PHP is used for
PHP is commonly used to:
- Process forms (login, signup, contact forms)
- Work with databases (MySQL, PostgreSQL, etc.)
- Build authentication systems (users, sessions, roles)
- Create APIs
- Power CMS platforms like WordPress, Drupal, Joomla
- Build full web apps (Laravel, Symfony, CodeIgniter)
Simple example
<?php
echo "Hello, world!";
?>
That code runs on the server and sends:
Hello, world!
to the browser.
PHP vs HTML vs JavaScript
- HTML → structure of the page
- CSS → styling
- JavaScript → runs in the browser (interactivity)
- PHP → runs on the server (logic, database, security)
PHP often works with JavaScript, not instead of it.
Bottom line
PHP is:
- 🧠 Backend logic
- 🗄️ Database interaction
- 🔐 Authentication & security
- 🌐 Web application engine
