System:Form:isPhoneNumber

From Aspen Documentation

Validates that the current value of a field is a valid US phone number.

Since 1.0

Arguments

boolean isPhoneNumber (string $field)

field
Name of the form field currently loaded.

Returns

Returns boolean.

Examples

Example:

if(!$this->APP->form->isPhoneNumber('field_name')){
     $this->APP->form->addError('field_name', 'An error message');
}