Validate_IR
[ class tree: Validate_IR ] [ index: Validate_IR ] [ all elements ]

Class: Validate_IR

Source Location: /Validate_IR-0.1.0/Validate/IR.php

Class Overview


Specific validation methods for data used in the Iran.


Author(s):

Copyright:

  • 2011 Arash Hemmat

Methods


Inherited Variables

Inherited Methods


Class Details

[line 22]
Specific validation methods for data used in the Iran.

PHP version 5

This source file is subject to the New BSD license, That is bundled with this package in the file LICENSE, and is available through the world-wide-web at http://www.opensource.org/licenses/bsd-license.php If you did not receive a copy of the new BSDlicense and are unable to obtain it through the world-wide-web, please send a note to pajoye@php.net so we can mail you a copy immediately.



[ Top ]


Method Detail

alphaNumeric   [line 33]

boolean alphaNumeric( string $check)

Check for Persian/Farsi characters and number an zero width non-joiner space.

Also accpets latin numbers preventing potential problem until PHP becomes fully unicode compatible.

  • Access: public

Parameters:

string   $check   —  The value to check.

[ Top ]

creditCard   [line 61]

boolean creditCard( string $check)

Validation of Iran credit card numbers.
  • Access: public

Parameters:

string   $check   —  The value to check.

[ Top ]

mobileNumber   [line 89]

boolean mobileNumber( string $check)

Checks mobile numbers for Iran

Parameters:

string   $check   —  The value to check.

[ Top ]

numeric   [line 47]

boolean numeric( string $check)

Checks for Persian/Farsi digits only and won't accept Arabic and Latin digits.
  • Access: public

Parameters:

string   $check   —  The value to check.

[ Top ]

phoneNumber   [line 75]

boolean phoneNumber( string $check)

Checks phone numbers for Iran
  • Access: public

Parameters:

string   $check   —  The value to check.

[ Top ]

postalCode   [line 103]

boolean postalCode( string $check)

Checks postal codes for Iran
  • Access: public

Parameters:

string   $check   —  The value to check.

[ Top ]

ssn   [line 124]

boolean ssn( string $check)

Checks social security numbers for Iran called "kode melli".

kode melli's last digit from left is the check digit, here is the algorithm: A= last digit from left B= (first digit*10) + (2th digit*9) + ... (9th digit *2) C= B – (B/11)*11 if C==0 and A==0 OK if C==1 and A==1 OK if C>1 and A==(C-11) OK

  • Access: public

Parameters:

string   $check   —  The value to check.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:43:21 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.