Here is what I have: First, I set up two arrays to be used later (from a mysql query): [code=php:0] while($alinks = mysql_fetch_array($listlinks)) { $clinks[] = $alinks['link']; $cid[] = $alinks['article_id']; } [/code] Now I check to see if a new set of links matches any in the $clinks array: [code=php:0] $nc = 0; $pos = 0; foreach($info[items] as $in) { if(in_array($info[items][$nc][link], $clinks)) { $pos = strpos($info[items][$nc][link], $clinks); $abar = '<a href="/article/'. $cid[$pos] .'"><img src="/images/art/indexed.gif" border="0"></a>'; } else { $abar = '<img src="/images/art/notindexed.gif">'; } $nc = $nc + 1; } [/code] If the link already exists, I want the 'article_id' of the matched link to be placed in to the href. Hence I have the $cid array with the $pos variable giving the position with $cid[$pos]. Unfortunately, this isn't working as I had hoped, and only gives the same number for all the links that match. ANy suggestions? Thanks Ryan