courses / php / level 1

level 1 · easy

php for
beginners.

From zero to your first real PHP programs. Every new word explained, every example runnable, one idea per lesson.

  • 28 lessons
  • 7 units
  • 3 h 26 m in all
  • £0, for good

what’s inside.

For people who have never written a line of code. Nothing is assumed: every new word is explained the moment it appears.

PHP Level 1 assumes nothing. In 28 short lessons you go from what code is to writing your own functions, with a guess, a hands-on task and a fix-the-bug challenge in every lesson. It ends with a level check: a sports day score board you build yourself.

every lesson goes the same way.

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

unit 1

Say hello

Make the computer do exactly what you tell it.

4 lessons · 27 min

  1. What code really is5 minFind out what code is and run your very first program.
  2. Your first line7 minMake the computer show any message you like.
  3. Echoing more than once7 minShow several lines, and blank lines, in the order you choose.
  4. When it goes wrong8 minRead error messages and fix the slips you will see most.

unit 2

Boxes with names

Make the computer remember things.

4 lessons · 27 min

  1. A variable is a labelled box7 minStore a value in a box and get it back by its name.
  2. Boxes can change7 minSwap what is in a box, copy boxes and join strings.
  3. Good names, bad names6 minChoose names that PHP accepts and people understand.
  4. Pretend someone typed it7 minPlay the visitor and give your program answers to work with.

unit 3

Words and numbers

Tell text and numbers apart and use both.

4 lessons · 30 min

  1. Text vs numbers7 minSpot the difference between a string and a number.
  2. Doing maths8 minAdd, take away, multiply and divide like a pocket calculator.
  3. Tricks with text8 minShout, whisper, tidy and count your strings.
  4. Putting values inside text7 minDrop values straight into your sentences.

unit 4

Make decisions

Make your program choose what to do.

4 lessons · 30 min

  1. If this, do that8 minMake your program do something only when it should.
  2. Otherwise…6 minGive your program a plan B for when the answer is no.
  3. More than two choices8 minCheck one thing after another and pick the right path.
  4. And, or, not8 minLink conditions together to ask smarter questions.

unit 5

Repeat yourself

Do the same thing many times without copying.

4 lessons · 31 min

  1. Counting with for8 minRepeat lines as many times as you like with a for loop.
  2. Repeating with while8 minKeep a loop going until its condition turns false.
  3. Loops that decide8 minCheck every number in a loop and count the ones that match.
  4. Stopping early7 minJump out of a loop, or skip a turn, when you need to.

unit 6

Arrays

Keep many things together and work through them.

4 lessons · 30 min

  1. Making an array7 minKeep lots of values together in one variable.
  2. Reading and changing items8 minPick out, swap and add items by their place in an array.
  3. Looping over an array7 minVisit every item in an array and add them all up.
  4. Searching an array8 minFind the biggest, the smallest, or one thing in an array.

unit 7

Your own commands

Wrap code up so you can use it again.

4 lessons · 31 min

  1. Making a function7 minWrap lines of code under one name and run them whenever you like.
  2. Giving it information8 minHand your function a value so it can do something new each time.
  3. Getting an answer back7 minMake a function hand you a result you can keep and use.
  4. Putting it all together9 minBuild a small program from functions, arrays, loops and decisions.
end of level 1 level check: a sports day score board Build one small project with everything from this level. Pass it and your face levels up. see the check

next, level 2

intermediate
php.

Build useful things with PHP: forms, files, JSON and real databases, safely and step by step.

see level 2