Skip to content
Advertisement

How to remove empty array from multidimensional array in php?

Currently I’m stuck and lost with trying to remove empty arrays from a csv file and actually don’t understand how I’m pulling up an empty array. I’m pulling 5 random rows from a csv file which works but I keep getting only 1 blank array after a shuffle.

My output:

JavaScript

After looking around I thought array_map and array_filter would work but it clears my whole array

JavaScript

My code:

JavaScript

Advertisement

Answer

Decided to not go furter with using PHP arrays, just going to call it using js arrays

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement