Validators.
More...
|
const n const static | email ($value) |
| Check an e-mail address for syntax and host. More...
|
|
static | postcode ($country, $value) |
| Check a postal code for syntax. More...
|
|
static | address ($country, $street, $number, $postcode, $town, $state=null) |
| Check all parts of an address for syntax. More...
|
|
static | iban ($value) |
| Check if an International Bank Account Number (IBAN) is valid. More...
|
|
static | vatNo ($value, &$info=null) |
| Check if an European VAT number is valid. More...
|
|
Validators.
Definition at line 8 of file Valid.php.
◆ address()
static address |
( |
|
$country, |
|
|
|
$street, |
|
|
|
$number, |
|
|
|
$postcode, |
|
|
|
$town, |
|
|
|
$state = null |
|
) |
| |
|
static |
Check all parts of an address for syntax.
- Parameters
-
string | $country | Country code (ISO 3166-1 alpha-2). |
string | $street | Street name. |
string | $number | House number. |
string | $postcode | Postal code. |
string | $town | Town or city. |
string | $state | State or province. |
- Returns
- string|bool Formatted address when valid. False when invalid.
Definition at line 149 of file Valid.php.
◆ email()
const n const static email |
( |
|
$value | ) |
|
|
static |
Check an e-mail address for syntax and host.
- Parameters
-
string | $value | E-mail address. |
- Returns
- bool True if both the e-mail address and the host are valid.
Definition at line 121 of file Valid.php.
◆ iban()
Check if an International Bank Account Number (IBAN) is valid.
- Parameters
-
string | $value | IBAN (may have extra formatting characters). |
- Returns
- string|bool Formatted IBAN when valid. False when invalid.
Definition at line 166 of file Valid.php.
◆ postcode()
static postcode |
( |
|
$country, |
|
|
|
$value |
|
) |
| |
|
static |
Check a postal code for syntax.
- Parameters
-
string | $country | Country code (ISO 3166-1 alpha-2). |
string | $value | Postal code. |
- Returns
- string|bool Formatted postal code when valid. False when invalid.
Definition at line 130 of file Valid.php.
◆ vatNo()
static vatNo |
( |
|
$value, |
|
|
& |
$info = null |
|
) |
| |
|
static |
Check if an European VAT number is valid.
- Parameters
-
string | $value | VAT number (may have extra formatting characters). |
array | $info | Returns extra info related to a valid VAT number. |
- Returns
- bool True when valid. If the VAT number could not be checked online this will always be true, $info then holds an error message.
Definition at line 180 of file Valid.php.
◆ IBAN_FORMATS
const n const IBAN_FORMATS |
Initial value:= [
'AL' => '\\d{8}\\w{16}'
Definition at line 45 of file Valid.php.
◆ POSTCODE_FORMATS
Initial value:= [
'BE' => ['(\\d{4})',[],'$1',"* #\n% @@\nBELGIUM"]
Definition at line 10 of file Valid.php.
The documentation for this class was generated from the following file:
- /var/www/fred.local/vendor/rsi/helpers/src/Rsi/Valid.php