Hello all.
I\'m using the eregi_replace() function and getting strange results. Let me share the code with you, and then I will explain what the problem is:
<?
$query = \"SELECT description from members where nick like \'$nick\'\";
$desc = mysql_query($query);
while ($myrow=mysql_fetch_array($desc)){
for($m = 0; $m < count($words); $m++) {
echo \"$m \n\";
$paco = eregi_replace($words[$m], \"<font color=red><b>$words[$m]</b></font>\", $myrow[0])
or die (\"Couldn\'t replace words in message\");
}
}
echo \"$paco\n\";
?>
$words is an array.
when I run this function with only one value in $words, it works fine, but when it runs with $words having many values, the eregi_replace does nothing, and yet there are no errors.
Along with this problem, there is another. Whenever one of the values of $words has a special character in it (i.e. *, {, [, , etc), I recieve errors.
Anyone have any idea?
Thank you in advance for any help you might provide.
John