Wordfilter that doesn't replace already filtered content
<p>I have <em>wordfilter</em> table in MySQL, and I use PHP to get all rows from it and replace them inside string.</p>

<pre><code>$string = "test string";
$result = mysqli_query($conn, "SELECT * FROM wordfilter;");
while ($row = mysqli_fetch_assoc($result))
{
    $string = str_replace($row['search'], $row['replace'], $string);
}
</code></pre>

<p>It will work like this:</p>

<pre><code>Iteration number: (row from table) - result string
0: "tt string e"
1: ("tt", "&lt;b&gt;test&lt;/b&gt;") - "&lt;b&gt;test&lt;/b&gt; string e"
2: ("e", "f") - "&lt;b&gt;tfst&lt;/b&gt; string f"
etc.
</code></pre>

<p>I want it to have this result <code>"&lt;b&gt;test&lt;/b&gt; string f"</code> (the "e" doesn't replace with "f" in <code>&lt;b&gt;test&lt;/b&gt;</code>, because it wasn't present in input string).</p>
