Hey guys,
I'm trying to get a better grasp on arrays and I'm having some trouble
basically what I want to do is create and array of Canadian Postal Codes(first letter only)
<?php
$can_array = array ("A" => "NF", "B"=> "NS","C" => "PE");
?>
I'll use 3 codes as an example...
I take the incoming postal code and substring the first letter, what I want to do is if that first letter is in the array and matches the province that the user entered.... return true else if the first letter is not in the array or it doesn't equal the value return false.
I'm not sure what the best way to do this is 🙁
any help? thanks!