Keep original string format when using str_ireplace
<p>I have a search feature which is coded below and i was wondering whether it is possible to keep the original formatting. for example if i have the following piece of text, "Hello, I'm new to PHP" and in my search box i type "php" in lower case, in the results it will change the original upper case 'PHP' to a lower case 'php'. is it possible to leave the string at its original state of PHP whether the user searches PhP or pHp etc.</p>

<p>here is the function containing the 'str_ireplace'...</p>

<pre><code>function boldText($text, $kword) {
    return preg_replace('/($kword)/i', "&lt;strong&gt;&lt;font color='Red'&gt;$kword&lt;/font&gt;&lt;/strong&gt;", $text);
</code></pre>

<p>and here is where it is called...</p>

<pre><code> echo "&lt;td width = 130px&gt;&lt;b&gt;".boldText($info['company_name'], $kword) . "&lt;/b&gt;&lt;/td&gt; ";
 echo "&lt;td width = 60px&gt;".boldText($info['section_name'], $kword) . " &lt;/td&gt;"; 
 echo "&lt;td width = 300px&gt;".boldText($info['question'], $kword) . " &lt;/td&gt;";
 echo "&lt;td width = 600px&gt;".boldText($info['answer'], $kword) . " &lt;/td&gt;&lt;/tr&gt;"; 
</code></pre>

<p>Thanks</p>
