Check if a field is empty How to you check that a field is empty, when you have the $node object?.

I found this as possible solution:

$field = field_get_items('node', $node, 'field_post_image');


I can check now:

UPDATE.Ups! This not reliable, althought I promise that it worked for me yesterday.

isset($field);


but I wonder if there is a better way.

Enlighten me
If you read up on the documentation the function returns FALSE if there is no data. isset() would actually fail because you are assigning FALSE to the variable so it's actually been set to something. The correct syntax would be:

$field = field_get_items('node', $node, 'field_post_image');
if ($field) {
   //Do something with the field
}
else{
   //There are no results
}