I have over 3500 small strings called "Forward sortation areas". They are the first three digits of canadian zipcodes. They follow a logical alphanumerical order.
Exemple: H2W, H2X, H2Y, H2Z, H3A, H3B etc..
I need to define a "pricelevel" value for those FSAs in an if/else statement, and luckily, they go a big bunch at a time. What i'm trying to do is something like this:
$fsa = "H2V" ;
if ($fsa >= "H2A" and <= "H2R") {
$pricelevel = "1";
} elseif ($fsa >= "H2S" and <= "H3B") {
$pricelevel = "2";
} elseif ($fsa >= "H3C" and <= "H4M") {
$pricelevel = "3";
}
In this case, $pricelevel would be "2".
If i'm not mistaking it's impossible to use these operators on alphanumerical strings. There's got to be a way of doing this but i cant figure out. Thanks in advance for your precious help.