PHP (PHP: Hypertext Preprocessor) is a server-side scripting language. PHP code runs on the server, and the browser only receives the resulting HTML.
What PHP can do
Generate dynamic page content.
Read and save data in databases such as MySQL.
Handle forms, logins, sessions and cookies.
Create, read and upload files.
Power frameworks and CMSs like Laravel, Symfony and WordPress.
PHP files end in .php and can mix HTML with PHP code.
💡 Key Takeaways: PHP Introduction
Mastering PHP Introduction helps you write clean and reliable PHP code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.
PHP Introduction Code Example
PHP
<!DOCTYPE html>
<html>
<body>
<h1><?php echo "Hello from PHP!"; ?></h1>
<p>Today is <?php echo date("l"); ?>.</p>
</body>
</html>
Output
Hello from PHP!
Today is Thursday.
Run this example on your own computer. The "Get Started" lesson shows how to set it up.