PHP PHP Arrays and Control Structures PHP Loops Sorting Multidimensional Arrays

Helen Ladrick
Helen Ladrick
1,363 Points

Is it just me or is this really complex for a beginner? Can someone explain how to filter an array in simpler terms?

I don't understand what Alena is talking about and she's moving too quickly in the video. When I google about it I'm seeing a function called: array_filter. This is not the same thing? Someone please give a clear and simple example of a filtered array.

Nicholas Mejia
Nicholas Mejia
22,884 Points

array_filter has a broader use case vs what Alena is accomplishing in her video. Using array_filter allows you to pass an array and a callback function that that array will be passed through. A theoretical use case in the context of the video, it that the sorting functionality Alena wrote gets put into a function you define and then rather than having a big messy file of procedural code, you can just reference the function with the sorting logic in what would hopefully be more structural code.

2 Answers

Thomas Hewitt
Thomas Hewitt
17,003 Points

Completely agree. PHP isn't even my first programming language and I'm wondering what on earth is going on.

Ker Sing Tan
Ker Sing Tan
10,568 Points

Same here. Super confused now. I cant catch what Alena talking about. The way of explanation just does not make thing clear for a beginner