PHP
Checking if an object is empty – PHP
As of PHP 5, objects with no properties are no longer considered empty. Therefore is you use empty() to test if an object is empty will always return true.
The easiest way to check for an empty object is to cast it to an array:
$objAsArray = (array)$object;
if ( empty( $objAsArray ) {…}
Incidently there are a [...]
Drupal 6 – Views, programmatically set arguments
It is sometimes useful to programmatically load a view in Drupal, to execute it and then utilise the results. This is all straightforward and well documented. A little less documented is how to set the view arguements.
PHP Alternative Syntax for UI
PHP has a slightly underused alternative syntax for control structures, which generally is more effective in template files than the standard block-style code.