cvs: pear /Validate/Validate UK.php
| From: | Pierre-Alain Joye | Date: | Sun, 16 Feb 2003 17:30:25 +0000 |
| Subject: | cvs: pear /Validate/Validate UK.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-8892@lists.php.net to get a copy of this message | ||
pajoye Sun Feb 16 12:30:25 2003 EDT
Added files:
/pear/Validate/Validate UK.php
Log:
initial commit, postalcode check
Index: pear/Validate/Validate/UK.php
+++ pear/Validate/Validate/UK.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Pierre-Alain Joye <paj@pearfr.org> |
// | |
// +----------------------------------------------------------------------+
//
// $Id: UK.php,v 1.1 2003/02/16 17:30:25 pajoye Exp $
//
// Specific validation methods for data used in UK
//
require_once 'Validate.php';
class Validate_UK
{
function valid_postcode_uk($code){
if(is_array($code)){
extract($code);
}
return (ereg ('^[A-Z]{1, 2}[0-9]{1, 2}[A-Z]{0, 1} [0-9][A-Z]{2}$', $str));
}
}
?>