List of available validations
Validate an Irish PPSN number
The Personal Public Service Number (PPS No) is an identifier issued by Client Identity Services, Department of Social and Family Affairs on behalf of the Minister for Social and Family Affairs in the Republic of Ireland.
sample
<?php // Include the package require_once 'Validate/IE.php'; $badSsn = '012345674'; $result = Validate_IE::ssn($badSsn); echo 'Test ' . $badSsn .' : <br />'; var_export($result); echo '<br /><br />'; $goodSsn = '1234567W'; $result = Validate_IE::ssn($goodSsn); echo 'Test ' . $goodSsn .' : <br />'; var_export($result); ?> |
Output :
Test 012345674 : false Test 1234567W : true |
Validate an Irish postcode
THERE IS NO POSTAL CODE IN IRELAND (In year 2007 however are suposed to be coming in 2008)
Validate a phonenumber
Ireland has phone numbers that are built similarly than US and Canada however they have a couple distinctions that make them proper to themselves.
For instance Dublin has codes 01 however Cork has 021, Galway 091, and so on.
Also allows the formats, (xxx) xxx-xxxx, xxx xxx-xxxx, and now x (xxx) xxx-xxxx , xxx-xxx-xxxx, xxx xxx xxxx, xx xxx xxxx or various combination without spaces or dashes.
sample
<?php // Include the package require_once 'Validate/IE.php'; $phoneNumber = '467875098x'; $result = Validate_IE::phoneNumber($phoneNumber); echo 'Test ' . $phoneNumber .' : <br />'; var_export($result); echo '<br />'; $phoneNumber = '014142438'; $result = Validate_IE::phoneNumber($phoneNumber); echo 'Test ' . $phoneNumber .' : <br />'; var_export($result); ?> |
Output :
Test 467875098x : false Test 014142438: true |
sample
See now with the parameter
<?php // Include the package require_once 'Validate/IE.php'; $phoneNumber = '87509824'; $result = Validate_IE::phoneNumber($phoneNumber,false); echo 'Test ' . $phoneNumber .' : <br />'; var_export($result); echo '<br /><br />'; $phoneNumber = '8750987'; echo 'Test ' . $phoneNumber .' : <br />'; echo 'With $requireAreaCode false <br />'; $result = Validate_IE::phoneNumber($phoneNumber,false); var_export($result); echo '<br />'; echo 'With $requireAreaCode true<br />'; $result = Validate_IE::phoneNumber($phoneNumber,true); var_export($result); echo '<br /><br />'; $phoneNumber = '(0915)8750987'; echo 'Test ' . $phoneNumber .' : <br />'; echo 'With $requireAreaCode false <br />'; $result = Validate_IE::phoneNumber($phoneNumber,false); var_export($result); echo '<br />'; echo 'With $requireAreaCode true<br />'; $result = Validate_IE::phoneNumber($phoneNumber,true); var_export($result); ?> |
Output :
Test 87509824 : true Test 8750987 : With $requireAreaCode false true With $requireAreaCode true false Test (091)8750987 : With $requireAreaCode false false With $requireAreaCode true true |
Пред. | Начало | След. |
Introduction | Уровень выше | Validate_IN |