0Pricing
PHP Academy · Lesson

Your First Look at PHP Code

Write and run your first PHP program.

Your First Look at PHP Code is a free PHP Academy lesson on CoddyKit — lesson 3 of 3. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the PHP Academy learning path, one of 3 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Time for real code

Exciting moment! 🎈 Let's peek at actual PHP. Don't worry, it's gentler than you think.

The magic tag

PHP code starts with a special tag: <?php. It tells the server, "PHP starts here."

Saying hello

The word "echo" tells PHP to print something out. It's how you make text appear on a page.

Your first line

Here's a tiny program. Tap run and watch it greet the world! 👋

<?php
echo "Hello, world!";

That was it!

You just ran real PHP. Two short lines, and the page said hello. See? Not scary at all. 😊

Text in quotes

Notice the words sat inside "quotes." In PHP, text you want shown is wrapped in quotes.

Lines end with ;

Each instruction ends with a semicolon (;). It's like a period at the end of a sentence.

Storing a value

Variables start with a $. They're little labeled boxes that hold things, like your name.

<?php
$name = "Alex";
echo $name;

Mix and match

That's the whole idea: store values, then echo them out. You just read and ran real PHP. 💪

You did it! 🎉

You finished your first PHP course! You know what PHP is, where it runs, and how its code looks. Amazing work!

Quick Check

Last one! Which keyword tells PHP to print something out?

Frequently asked questions

Is the “Your First Look at PHP Code” lesson free?

Yes — the full text of “Your First Look at PHP Code” is free to read here on the web, and the PHP Academy course includes 3 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the PHP Academy course, upgrade to CoddyKit PRO.

What will I learn in “Your First Look at PHP Code”?

Write and run your first PHP program. You practise PHP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start PHP Academy?

No prior experience is required. PHP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 3, so you can start here or from the beginning and move at your own pace.

How long does the “Your First Look at PHP Code” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this PHP Academy lesson?

Yes. Every PHP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. What is PHP?
  2. Where PHP Runs the Web
  3. Your First Look at PHP Code
← Back to PHP Academy