This forum is now read-only. Please use our new forums at

574 points
Submitted by
over 5 years ago

Suggestion: Probably not the best example?

First of all, I'm sorry if I'm being picky. I know this PHP section was recently released and I am deeply appreciative to learn PHP from this website =).

But I just noticed this example in the section and can't help but think it's a little incorrect from what we've been taught in the previous lessons:

Finally, you can remove elements using unset:

  $array = ("red", "blue", "green");
  1. We've been taught to put array before the list:

    $array = array("red", "blue", "green");

  2. And there isn't a fourth item in the list xD, so probably: "unset($array[2]);" would be better.

Hope this doesn't offend anyone!

1 vote


Nicely spotted! I agree.
The author himself has written here that we declare an array by using array();

2570 points
Submitted by
Gaurang Tandon
over 5 years ago

0 votes


Thanks - I'll let our course creators know.

978 points
Submitted by
Linda Liukas
over 5 years ago