PHP CHAPTER 01

PHP Intro

PHP stands for PHP: Hypertext Preprocessor. It is designed mainly for server-side web development.

📘

What is it?

PHP stands for PHP: Hypertext Preprocessor. It is designed mainly for server-side web development.

💡

Why do we use it?

PHP allows websites to generate content dynamically instead of showing only fixed HTML.

⚙️

How does it work?

PHP code runs on the server. The browser receives the final generated output rather than the PHP source code.

🧩

Syntax

PHP Syntax
<?php
statement;
?>
💻

Example

PHP Example
<?php

echo "PHP runs on the server.";
echo "<br>";
echo "AIFA Infotech";

?>
🔍

Example Explained

The first echo displays a message. <br> creates a new HTML line. The second echo displays the institute name.
🚀

More Examples

<?php $course = "PHP Development"; echo "Course: " . $course; ?>

⚠️ Important Rules

PHP is different from JavaScript because PHP normally executes on the server.

❌ Common Mistakes

Expecting PHP code to run when opening a file directly without a server.

🌍 Real-World Use

PHP is used for websites, APIs, authentication, CMS platforms and database applications.

📝 Practice Exercise

Create a page that displays a PHP welcome message and your current course.

💻 Try It Yourself

Write and run this PHP lesson inside the AIFA Coding Lab.

Open Coding Lab →