How to correct url path I am using a key to connect with it's node nid but when I click on Next it gives path /node/node/256 instead of node/256. Here is my code:

$key = array_search($nid , $nids);
print $key;
$next = ($key + '1');
$previous = ($key - 1);
$total=count($nids);
$next_link =    "&lt;a href='node/$nids[$next]'&gt;Next&lt;/a&gt;";
$previous_link = "&lt;a href='node/$nids[$previous]'&gt;Previous&lt;/a&gt;";


$nids is an array. How to handle this situation?
Use l() to construct URLs in Drupal.
$next_link = l('Next', 'node/' . $nids[$next]);
$previous_link = l('Previous', 'node/' . $nids[$previous]);