Daniel Fitzhugh7,025 Points
Why does array_rand() return a "meta-array" of keys, and not just the original array with a reduced number of items ?
I noticed a recurring theme with the videos in this course regarding how to "filter" or "select a subset" from a master array. I've seen the same confusing technique in both of these videos:
The teacher always seems to create a "meta-array" of keys, and then juggles the parameters (in a really confusing way) to get the results that she wants.
Would it not be easier --- especially for this task, "Random fun with arrays" --- if array_rand() just produced an array which was similar in structure to the master array, which we could then iterate through using a "foreach" loop, without having to do all of the confusing parameter juggling that the teacher does whenever she uses her preferred technique ?
Sorry if this is confusing.... it confuses me also :)