i want to find a keyword inside a string, im trying to make the script to find it and then replace it, but only that keyword (of course if others are found, replace them as well). but im lack of experience for this job and im trying to do it just for practice. this is my beginning code:

```
 $var = array(
    '{test1}' => 'something1',
    '{test2}' => 'something2',
    '{test3}' => 'something3'
);

$output = 'Please work it var {test1}!';

foreach($var as $element)
{
    if(strstr($output, $element) !== false)
    {
        echo 'not found<br>';
    }
    else
    {
        echo 'found<br>';
    }
}

```

for now im just checking if its found, but what i dont understand, why its repeating? it should just say "found" once and then say "not found", like this (found, not found, not found).

output:

```
found
found
found

```