Skip to content

Instantly share code, notes, and snippets.

@wisbey
Created October 3, 2012 11:52
Show Gist options
  • Save wisbey/3826550 to your computer and use it in GitHub Desktop.
Save wisbey/3826550 to your computer and use it in GitHub Desktop.
PHP: removing row from a multidimensional array if empty
$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