0
0
PHPprogramming~15 mins

What is PHP - Hands-On Activity

Choose your learning style9 modes available
What is PHP
📖 Scenario: Imagine you want to create a website that can show different messages to visitors depending on the time of day. PHP helps you do this by running code on the server before the page reaches the visitor.
🎯 Goal: Learn the basics of PHP by creating a simple PHP script that displays a message.
📋 What You'll Learn
Create a PHP file
Write PHP code inside PHP tags
Use echo to display text
Run the PHP script to see the output
💡 Why This Matters
🌍 Real World
PHP is widely used to build websites that show different content to users, like online stores or social media sites.
💼 Career
Knowing PHP helps you work as a web developer creating interactive websites and web applications.
Progress0 / 4 steps
1
Create a PHP file with PHP tags
Create a PHP file and write the opening PHP tag <?php and the closing PHP tag ?>.
PHP
Need a hint?

PHP code must be inside <?php and ?> tags.

2
Add a message to display
Inside the PHP tags, write echo "Hello, PHP!"; to display the message.
PHP
Need a hint?

Use echo to print text in PHP.

3
Run the PHP script
Run the PHP script on a server or local environment to see the message Hello, PHP! displayed.
PHP
Need a hint?

Use a local server like XAMPP or an online PHP tester to run your script.

4
Display the output
Print the output of the PHP script which should be Hello, PHP!.
PHP
Need a hint?

The output is the text printed by the echo statement.