In my current script, I would like to have certain text be recognized as case sensitive. For example, if the value is "OMM" the code below will accept "omm" and "OmM" and any form of the text. "$replace_strings = array_values($mapping);" Is there any way to make this value case sensitive? Thanks in advance for your reply.
Do you mean case-insensitive? If you want it to match any casing, then convert all values to lower case with str_to_lower()
It already matches any casing. I need the characters to match the exact casing, which would be only upper case characters.
For example, I only want to have "PHP" recognized and the value should ignore Php, php or PHp. I hope this is being explained clearly. Thanks.
The function strcmp will do case-sensitive string comparisons... However: having another look at the snippet of code you've provided, I can't see how that is case-insensitive (there's no string comparisons at all). I'm guessing that where you use $replace_strings is where you will need to do the case-sensitive work, but we would need to see where you use it to actually help.
str_replace() is case sensitive. http://us3.php.net/manual/en/function.str-replace.php str_ireplace() is case insensitive. http://us3.php.net/manual/en/function.str-ireplace.php