I have a string containing an address and I need to know which street type that address is using. Here is an example:
$street = "100 road Overflow";
$streetTypes = array("ROAD", "ST", "ABBEY", "BLVD", "ALLEY", "CAR");
//find and save the street type in a variable
//Response
echo "We have found ".$streetType." in the string";
Also, the address is submitted by a user and the format is never the same which complicate things. So far, I've seen format like these:
100 ROAD OVERFLOW
100,road Overflow
100, Overflow road
What's the best way to address this problem?