I want to change the value of a field for a node.I used the following code:
$node = node_load($nid); // $nid is the function's parameter
$node->field['field_myfield'][$node->language][0]['value'] = 1;
node_save($node);
The problem is $node->language
returns es
while in print_r($node)
it's und
.
Why $node->language
is different from what's in $node array and how can I get it?