Validate_FI::phoneNumber
Validate_FI::phoneNumber() – Validate Finnish telephone number
Synopsis
require_once 'Validate/FI.php';
bool Validate_FI::phoneNumber
(
string $number
)
Description
Validate Finnish telephone number.
Simple check: number must be numeric when (, ), -, +, ., ' ' chars are removed and 3-20 digit number.
Parameter
-
string
$number
-
The telephone number to be validated
Return value
boolean - true if telephone number is valid, false otherwise
Example
Using phoneNumber()
<?php
// Include the package
require_once 'Validate/FI.php';
$phoneNumber = '+358 40 1234567';
if ( Validate_FI::phoneNumber($phoneNumber) ) {
print 'Valid';
} else {
print 'Not valid!';
}
?>