Got! This worked for me:
$author_uid = token_replace('[node:author:uid]', array('node' => $node)); $nid = token_replace('[node:nid]', array('node' => $node));
You must pass $ node token_replace () functions, after which you will get the desired results. Hope this helps someone!
source share