Basically, I have a multidimensional array, and I need to check whether or not it is simply empty, or not.
I currently have an if
statement trying to do thi
You can filter the array, by default this will remove all empty values. Then you can just check if it's empty:
$filtered = array_filter($csv_array);
if (!empty($filtered)) {
// your code
}
Note: This will work with the code posted in your question, if you added another dimension to one of the arrays which was empty, it wouldn't:
$array = array(array()); // empty($filtered) = true;
$array = array(array(array())); // empty($filtered) = false;