예제 #1
0
 public function test_search_array()
 {
     $this->assertEquals('100 Biblica Way', Helper::searchArray('TN', $this->array, 1));
     $this->assertEquals('Advocate', Helper::searchArray('GA', $this->array));
     // return false for string not in array
     $this->assertFalse(Helper::searchArray('FL', $this->array));
 }
예제 #2
0
 /**
  * Return state AP abbreviations (Ga.,Fla.)
  * 
  * @param  string $value state name, alpha or numeric code
  * @return mixed 	boolean|string
  */
 public static function abbr($value)
 {
     return Helper::searchArray($value, self::$states_array, 3);
 }
예제 #3
0
 /**
  * Country numeric code (840,124)
  * @param  string $value country name, alpha code (2 or 3) or numeric code
  * @return mixed 	boolean|string
  */
 public static function numeric($value)
 {
     return Helper::searchArray($value, self::$countries_array, 3);
 }