how to identify first element in array of node objects? hook_node_load($nodes, $types) in Drupal 7 takes two arrays as parameters. In the module I'm working on (Drupal 7 port from Drupal 6), just one node of one type is being loaded. I tried $node[0] to specify the first node in the array, but no joy. How do I get at the first node and the first type? There is only one object in each array.
$nodes is keyed by the node ID, which you probably won't know in advance. Instead of directly trying to access the first node in the array, iterate over them with a foreach loop.

function mymodule_node_load($nodes, $types) {
  foreach ($nodes as $nid =&gt; $node) {
    if ($node-&gt;type == 'basic_page') {
      ...
    }
  }
}