Created
October 3, 2012 11:52
-
-
Save wisbey/3826550 to your computer and use it in GitHub Desktop.
PHP: removing row from a multidimensional array if empty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$arr = array(... your multi dimension array here ...); | |
foreach($arr as $idx => $row) { | |
if (preg_grep('/^$/', $row)) { | |
unset($arr[$idx]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment