Question: This is the code I have written so far:

```
foreach ($link_body as $key => $unfinished_link)
{   
    #further Remove non ad links
    if (stristr($unfinished_link, "inactive" OR "nofollow") === TRUE)
    {   
        unset($link_body[$key]);
    }   

    echo "<font color='#FFFFFF' size='16'>$unfinished_link</font><br>";
}

```

I'm not getting any error messages but I keep getting results that look like this:

```
/cars/" />
/cars/">
/cars/" class="inactive">(not what I wanted)
/cars/" class="inactive">(not what I wanted)
/cars/" class="inactive">(not what I wanted)
/cars/" rel="nofollow">(not what I wanted)
/cars/?layout=gallery" rel="nofollow">(not what I wanted)
/cars/2001-ford-escort-great-condition/1235588">(IS what I wanted)

```

Where am I messing up here guys? Thx

Answer: 
If you're trying to find a string inside that, maybe you indend to use `stripos` instead:

```
foreach ($link_body as $key => $unfinished_link) {
    // further Remove non ad links
    if(
        stripos($unfinished_link, 'inactive') !== false ||
        stripos($unfinished_link, 'nofollow') !== false
    ) {  
        unset($link_body[$key]);

    } else {
        echo "<font color='#FFFFFF' size='16'>$unfinished_link</font><br>";
        // make sure your background is not white, or else your text will not be seen, at least on the white screen
    }
}

```

If this is an HTML markup, consider using an HTML parser instead, `DOMDocument` in particular, and search for that attributes:

```
$rel = $node->getAttribute('rel'); // or
$class = $node->getAttribute('class');

```
Using [array\_filter](http://php.net/manual/en/function.array-filter.php) : 

```
function filterLink($link) {
 return  stripos($unfinished_link, 'inactive') === false &&
         stripos($unfinished_link, 'nofollow') === false
}

$unfinished_link = array_filter($unfinished_link, "filterLInk")

```