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

Class: Validate_IN

Source Location: /Validate_IN-0.1.1/Validate/IN.php

Class Overview


Specific validation for data pertaining to the Republic of India.


Author(s):

Copyright:

  • 2006 Byron Adams

Methods


Inherited Variables

Inherited Methods


Class Details

[line 47]
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 166]

bool 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: true on success false otherwise
  • Access: public

Parameters:

string   $code   —  2-letter region code

[ Top ]

licensePlate   [line 88]

bool licensePlate( string $number)

Validates an Indian Vehicle's license plate number.
  • Return: true on success false otherwise
  • Access: public

Parameters:

string   $number   —  the license plate number to validate.

[ Top ]

pan   [line 58]

bool pan( string $number)

Validates an Indian Permanent Account Number (PAN) or Tax deduction and collection Account Number (TAN).
  • Return: true on success false otherwise
  • Access: public

Parameters:

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

[ Top ]

phoneNumber   [line 233]

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 109]

bool postalCode( string $postalCode)

Validates an Indian Postal Code (ZIP code)
  • Return: true on success false otherwise
  • Access: public

Parameters:

string   $postalCode   —  The ZIP code to validate

[ Top ]

region   [line 143]

bool region( string $region)

Validates a state / union territory code and returns the full name of the state / union territory code passed.
  • Return: true on success false otherwise
  • Access: public

Parameters:

string   $region   —  2-letter region code

[ Top ]

ssn   [line 129]

bool ssn( string $ssn)

Validates an Indian Permanent Account Number (PAN) or Tax deduction and collection Account Number (TAN).
  • Return: true on success false otherwise
  • See: Validate_AU::pan()
  • Access: public

Parameters:

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

[ Top ]

stateCode   [line 74]

bool stateCode( string $stateCode)

Validates a state / union territory code and returns the full name of the state / union territory code passed.

Parameters:

string   $stateCode   —  2-letter region code

[ Top ]


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