iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

PHP Exercises

Each PHP lesson has a fill-in-the-blank exercise. Complete a short snippet with one or two missing tokens — the grader checks your answer against the expected result.

How it works

  • Read the instruction at the top.
  • Click the blank, type your answer, press Run.
  • A wrong answer triggers a hint; the second wrong try reveals the solution.

Why fill-in-the-blank

FormatWhat it tests
Multi-choice quizRecognition — "I've seen this."
Fill-in-the-blankRecall — "I can produce this."
Open-endedSynthesis — "I can build this from scratch."

Recall is the strongest predictor of retention. Blanks are kept small so cognitive load stays on the new concept.

Sample

PHP
// Instruction: echo "Hello, world!"
____ "Hello, world!";

Answer: echo.

Where to go next

  • Finish all 80+ PHP exercises to unlock the "Built it from blanks" badge.
  • Try the 30-day bootcamp for daily challenges.
  • Pair every exercise with a Try it Yourself » in the editor — vary the snippet to build intuition.
Tip: If a blank stumps you, scroll up — the lesson's example almost always demonstrates the answer.

Example

Example
<?php
// Fill-in-the-blank — complete the missing piece:
function greet($name) {
    return 'Hello, ' . $name;
}
echo greet('Ada');
Try it Yourself »

Exercise

Exercise format.

fill-in-the-

Test yourself

Q1. Format is…
Q2. Best for recall is…
Q3. Each lesson has…

Discussion

Loading…