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

Class: Validate_IN

Source Location: /Validate_IN-0.1.0/IN.php

Class Overview


Specific validation for data pertaining to the Republic of India.


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 19]
Specific validation for data pertaining to the Republic of India.

This class will validate Indian:

  • Postal Codes (Zip Codes)
  • State/U.T. Codes
  • Telephone Numbers
  • PAN/TAN Numbers
  • Vehicle license plate Numbers



[ Top ]


Method Detail

getStateName   [line 130]

String/Array getStateName( [String $code = NULL])

Returns the full name of a state / union territory given a valid state code. If state code is invalid or NULL, an array of all states is returned.
  • Return: Full name of state of code is valid, array of all states if not.
  • Access: public

Parameters:

String   $code   —  2 letter State / U.T. Code.

[ Top ]

licensePlate   [line 306]

boolean licensePlate( $number, string $license)

Validates an Indian Vehicle's license plate number.
  • Return: TRUE if code is valid, FALSE otherwise
  • Access: public

Parameters:

string   $license   —  The license plate number to validate.
   $number   — 

[ Top ]

pan   [line 34]

boolean pan( string $number)

Validates an Indian Permanent Account Number (PAN) or Tax deduction and collection Account Number (TAN).
  • Return: TRUE if code is valid, FALSE otherwise
  • Access: public

Parameters:

string   $number   —  The PAN or TAN to be validated.

[ Top ]

phoneNumber   [line 268]

bool phoneNumber( string $number)

Validate an Indian Phone number.

Allows the following formats:

(xxx) xxxxxxx xxx xxxxxxx +91 xxx xxxxxxx 091xxxxxxxxxx

where whitespaces, dashes and brackets may interchanged freely and 0/+ may be added / skipped wherever possible.

  • Return: True if number is valid, False otherwise
  • Access: public

Parameters:

string   $number   —  Phone number to validate (mobile or landline)

[ Top ]

postalCode   [line 52]

boolean postalCode( string $postalCode)

Validates an Indian Postal Code (ZIP code)
  • Return: TRUE if code is valid, FALSE otherwise
  • Access: public

Parameters:

string   $postalCode   —  The ZIP code to validate

[ Top ]

stateCode   [line 71]

bool stateCode( $stateCode, string $region)

Validates a state / union territory code and returns the full name of the state / union territory code passed.
  • Return: True if state code is valid, False otherwise.
  • Access: public

Parameters:

string   $region   —  2-letter state / union territory code
   $stateCode   — 

[ Top ]


Documentation generated on Thu, 10 Dec 2015 05:39:04 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.