PHP Ignore Case Sensitivity while comparing strings?
<p>Im trying to compare words for equality, and the case [upper and lower] is irrelevant.
However PHP does not seem to agree!</p>

<p>Any ideas as to how to force PHP to ignore the case of words while comparing them ??</p>

<p>Any help appreciated!</p>

<pre><code>$arr_query_words = array( "hat","Cat","sAt","maT" );
// for each element in $arr_query_words -
for( $j= 0; $j &lt; count( $arr_query_words ); $j++ ){

    // Split the $query_string on "_" or "%" :
    $story_body = str_replace( $arr_query_words[ $j ],
         '&lt;span style=" background-color:yellow; "&gt;' . $arr_query_words[ $j ] . '&lt;/span&gt;',
               $story_body );

// --- This ONLY replaces where the case [upper or lower] is identical -&gt;
}
</code></pre>

<p>Is there a way to carry out the replace even if the case is different???</p>

<p>Apologies for the vagueness of the original question.</p>

<p>Donal</p>
