Going About Explaining PHP

Well after the first day, I asked a few of my peers whether they now understand php better, and they said they do.

Thank you all for your help.

The best resource I found for arrays is the book “PHP 5 Zend PHP Certification Guide”. It’s explanation of arrays does little more than summarize, and but then prompts the user to dig into the manual to find out more.

But essentially, it breaks that mind boggling 80+ array functions into bite-sized blocks - all that is needed is some imagination and a fairly consistent sample data set to work on.

Creation.
How to create arrays - all the different ways.

Old School
To be able to traverse an array using old school functions - should ring a bell for those with JS experience
while, reset, key, current, next

Newer traversal
foreach, array_walk,

Peek inside;
While we can build and follow arrays in our minds, sometimes its better to see the proof of the pudding
print_r, var_dump

Flipping and reversing
array_flip, array_reverse,

Sorting arrays
There are 11 to choose from, just make sure everyone knows they exist.
sort, (and optional parameters like SORT_NUMERIC)
rsort, natsort, ksort, krsort natsort and shuffle() leave the arsort and kasort till you address functions later.

Arrays as Stacks Queues
Adding and removing items from the start and end of arrays.
array_push, array_pop vs array_shift, array_unshift

Sets
array_diff, array_intersect, array_intersect_key and the like

HTH