custodian Posted April 4, 2006 Share Posted April 4, 2006 I've been enhancing my payment module an would like to add a default This is what I'm trying to accomlish function _state_list() { $list = array('ALABAMA' => 'AL' , 'ALASKA' => 'AK' , 'AMERICAN SAMOA' => 'AS' , 'ARIZONA' => 'AZ' ...blah bla blah... ...blah bla blah... ...blah bla blah... ...blah bla blah... ...blah bla blah... ...blah bla blah... 'SASKATCHEWAN' => 'NON-US' , 'YUKON' => 'NON-US'); return $list; } Ideally what I would like to that anything that does not match the US states to automatically assign NON-US as the state. Currrently all I have Canada manually defined to identify the values in the array, but wish to trim down the code and allow it to be absolute in it's International ability. Hence anything not listed would be assigned Non-US. I've googled a few times, though it seems google doesn't like someone searching fo =>, "=>" or [=>] or any other varation... Yahoo returned a few examples, but nothing showing how to properly assign a default catch-all. Any help/examples would be appreciated. My Contributions Henry Smith Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.