Created
September 27, 2011 13:33
-
-
Save robwilkerson/1245045 to your computer and use it in GitHub Desktop.
CakePHP: Remove empty array elements at any level.
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
/** | |
* Removes items from an array where key information is missing. Useful in | |
* dynamic add situations. | |
*/ | |
$this->data['Date'] = Set::extract( '/Date[start=/\S+/][end=/\S+/]/.', $this->data ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment