Change color of matching string characters in for loop php
<p>I have this loop:</p>

<pre><code>for ($m=0; $m&lt;7; $m++){
if ($myextra[$m] == $drawextra[$m]) {
$myextra[$m] = '&lt;span class="matchx"&gt;'.$myextra[$m].'&lt;/span&gt;';
}
}
echo $myextra;
</code></pre>

<p>My echo output is as follows:</p>

<pre><code> 3445&lt;&lt;8
&lt;11&lt;&lt;6&lt;
&lt;45&lt;&lt;&lt;&lt;
</code></pre>

<p>The class in the  is from my stylesheet and should color the matched character in the string but the matched character is simply replaced by '&lt;'. They are in the correct position but how can I assign that class properly?</p>
