0

Possible Duplicate:
How to load a node based on its title?

I know the node title, and I want to get node id from the node title, I tried 2 ways but not working properly

// get node title from the url
$title = arg(2); 

$node = node_load(array('title' => $title));    
$nid = $node->nid;

print $nid;

errors are saying that Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() , Trying to get property of non-object

2

 $items = entity_load('node', FALSE, array(
            'type' => 'article',
            'title' => arg(2),
    ));

but then what I should do ?

0

Browse other questions tagged or ask your own question.