Modify search to ignore accents

I am working on a weather website and right now my search works likes this:
I write the city name (“Lima”) in the searchbox and it takes you to URL (
It works even with cities that have more than one word (“La Libertad”) and replaces the space between words with a hyphen (
What I want know is for it to ignore accents. F.e. If I write “Ancón” or “Ancon” in the searchbox, it should take me to the same place (
This is what the code looks like right now (including replacing space with a hyphen)… so how could I make it ignore accents? Thanks!


$search = array(" “);
$replace = array(”-");
$result = str_replace($search, $replace,$bus);

Sponsor our Newsletter | Privacy Policy | Terms of Service