If the assignment is in PHP I’m pretty sure you should create working code.
Are you allowed to use a proper editor or is this supposed to be written in notepad? A proper editor will highlight errors in the code so you don’t have to run the code to spot obvious mistakes (like missing semi colons).
For extra learning/knowledge (and perhaps even extra points). I suggest the following:
Use curly braces around control structures (if, loops, etc).
The assignment says add 15 elements to the array, can you modify your code in any way to make it clear you want exactly 15 elements?
When reading from the array is there any way to loop over every entry without hardcoding the length of the array? atm line 9 breaks if you change line 3.
Which loop of for/foreach/while makes the code most readable (perhaps a combination)? Why?
Why should we care about readable code?