I'm using the following to get the raw value of a field Drupal:
$foo = field_get_items('node', $node, 'field_foo'); $foo_shift = array_shift($foo); $foo_value = $foo_shift['value'];
Which works a treat but every so often I get the following error:
Warning: array_shift() expects parameter 1 to be array, boolean given in include() (line 106 of ).
I think it might have somehting to do with checking the value is set as I only get it after going to a page where the value isn't set. But if I try to check 'field_get_items('node', $node, 'field_foo')' is set that doesn't work.