I got this function:
preg_match("/öppet/iu", $string);
What if the "ö" is written as a html entity? Like this: ö
or Ö
Is there a way to find them as well?
I got this function:
preg_match("/öppet/iu", $string);
What if the "ö" is written as a html entity? Like this: ö
or Ö
Is there a way to find them as well?
Sure, just decode HTML entities before matching:
preg_match("/öppet/iu", html_entity_decode($string));
This has the benefit of working for other characters as well, e.g. if you want to match ä
too at some point in the future.