Inspekt\Inspekt::getAlpha PHP Метод

getAlpha() публичный статический Метод

Returns only the alphabetic characters in value.
public static getAlpha ( mixed $value ) : mixed
$value mixed
Результат mixed
    public static function getAlpha($value)
    {
        if (Inspekt::isArrayOrArrayObject($value)) {
            return Inspekt::walkArray($value, 'getAlpha');
        } else {
            return preg_replace('/[^[:alpha:]]/', '', $value);
        }
    }

Usage Example

Пример #1
0
 /**
  *
  */
 public function testGetAlpha()
 {
     $input = '0qhf01 *#R& !)*h09hqwe0fH! )efh0hf';
     $output = 'qhfRhhqwefHefhhf';
     $this->assertTrue(Inspekt::getAlpha($input) === $output);
     $input = array('1241DOSLDH', 'efoihr123-', 'eoeijfo1');
     $output = array('DOSLDH', 'efoihr', 'eoeijfo');
     $this->assertEquals(Inspekt::getAlpha($input), $output);
 }