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 (www.peruclima.com/ciudad/lima)
It works even with cities that have more than one word (“La Libertad”) and replaces the space between words with a hyphen (www.peruclima.com/ciudad/la-libertad)
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 (www.peruclima.com/ciudad/ancon)
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);