Example #1
0
 public function test_array_range()
 {
     $start = -2;
     $end = 5;
     $exclude = array(0, 4);
     $this->assertCount(8, Helper::arrayRange($start, $end));
     /// with an excluded range
     $this->assertCount(6, Helper::arrayRange($start, $end, $exclude));
     // start and end same
     $this->assertCount(1, Helper::arrayRange($start, $start));
 }
Example #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);
 }
Example #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);
 }