php - Why is strcasecmp not working? -


I am comparing a string in php, but strcasecmp always outputs that string is equal is not .

Here's my code:

  & lt ;? Php function multiexplode ($ delimiter, $ string) {$ ready = str_replace ($ delimiters, $ delimiters [0], $ string); $ Launch = explosion ($ delimiter [0], $ ready); Return $ launch; } $ Owner = "music not available: venha ja"; $ Owner_keys = multiexplode (array (".", ":", ""), Owner $); $ Musica_c = array ("music", "tips"); $ Music = 0; {Ifof ($ owner_keys) & gt; 1) {foreach ($ key_c as $ musica_c) {foreach ($ owner_keys $ cat) {if (strcasecmp ($ cat, $ key_c) == 0) { ++ $ musica; } And {echo "do not match" & lt; br & gt; "; }}}}? & Gt;   

Why strcasecmp detects different strings?

strcasecmp is doing its job properly

It matches the string of a pair that is Musica & amp; Musica . Just the end $ musica echo However, another string pair is different, which is tAatro & amp; Teatro . This is the reason why not matching.

This behavior is expected.


Comments