Categories
Programming

More Tips on Model View Controller

Found this link and thought that it had some nice breakdowns of the MVC.

http://www.bennadel.com/blog/2379-A-Better-Understanding-Of-MVC-Model-View-Controller-Thanks-To-Steven-Neiland.htm

 

http://www.htmlgoodies.com/beyond/php/article.php/3912211

Categories
Programming

PHP Empty Multidimensional Arrays

Discovered today that running empty() on a multidimensional array returns false.

http://forums.phpfreaks.com/topic/183410-checking-if-multidimensional-array-is-empty/

To get around this, I propose using array_filter on the multidimensional array first.  I’m betting this will not work for an array within an array within an array, but it seems to work fine for an array within an array.

So:

empty( array_filter( $multidim_array ) )