I have an array where I’m storing the bad and good string pairs.
Ex.:
array(
"Man. United"=>"Manchester United",
"Bay. Munchen"=>"Bayern Munchen",
"Bay. Munich"=>"Bayern Munchen",
...
)
so in this case I’m using strtr to replace the given string, but in this case I always have to add or remove data’s from the array. Is there any way to store just the good names in one array and replace which is very similar? For me is much easier to build up the array with the good names.
You could use similar_text or one of the other functions mentioned in the see also section to try and correct them automatically, but won’t be as accurate as if you list the spelling mistakes yourself.
*edit: levenshtein may also be a good one to try…