Skip to content
atomrus1993 edited this page Oct 17, 2018 · 3 revisions

If you have a problem with the letters in the phone number, as is the case with Russian numbers, this method will help you

['phone', 'filter', 'filter' => [$this, 'normalizePhone']],

public function normalizePhone($value) {
    $phone = preg_match("@[A-z]@u", $value);
    return !$phone ? $value : false;
}
Clone this wiki locally