FreenetIS
 All Classes Namespaces Functions Variables Pages
Static Public Member Functions | List of all members
valid Class Reference

Static Public Member Functions

static email ($email)
 Validate email, commonly used characters only.
static email_rfc ($email)
 Validate email, RFC compliant version Note: This function is LESS strict than valid_email.
static url ($url, $scheme= 'http')
 Validate URL.
static ip ($ip)
 Validate IP.
static ip_check_subnet ($ip, $net, $mask)
 Checks ip address if matches subnet and mask.
static credit_card ($number, $type= 'default')
 Validates a credit card number using the Luhn (mod10) formula.
static phone ($number)
 Checks if a czech phone number is valid.
static alpha ($str, $utf8=FALSE)
 Checks whether a string consists of alphabetical characters only.
static alpha_numeric ($str, $utf8=FALSE)
 Checks whether a string consists of alphabetical characters and numbers only.
static alpha_dash ($str, $utf8=FALSE)
 Checks whether a string consists of alphabetical characters, numbers, underscores and dashes only.
static digit ($str, $utf8=FALSE)
 Checks whether a string consists of digits only (no dots or dashes).
static numeric ($str)
 Checks whether a string is a valid number (negative and decimal numbers allowed).
static ulogd_active_count ($str)
 Checks whether a string is valid ulogd active count.
static standard_text ($str)
 Checks whether a string is a valid text.
static date ($date=array())
 Checks whether a array is valid date.
static date_string ($str)
 Checks whether a string is valid date.
static mac_address ($str)
 Checks whether a string is valid MAC address.
static ip_address ($str)
 Checks whether a string is valid IP address.
static suffix ($str)
 Checks whether a string is valid URL suffix.
static address_ranges ($str)
 Checks whether a string is valid network address range (in format eg.
static gps_string ($str)
 Checks whether string is valid GPS string.
static byte_size ($str)
 Checks whether string is valid byte-string.
static speed_size ($str)
 Checks whether string is valid speed size (eg.
static range ($number, $min=0, $max=100)
 Checks whether number is included in range.
static bank_account ($str)
 Checks whether string is valid bank account number.

Member Function Documentation

static valid::address_ranges (   $str)
static

Checks whether a string is valid network address range (in format eg.

10.0.0.0/8)

Author
MIchal Kliment
Parameters
string$str
Returns
boolean
static valid::alpha (   $str,
  $utf8 = FALSE 
)
static

Checks whether a string consists of alphabetical characters only.

Parameters
stringinput string
booleantrigger UTF-8 compatibility
Returns
boolean
static valid::alpha_dash (   $str,
  $utf8 = FALSE 
)
static

Checks whether a string consists of alphabetical characters, numbers, underscores and dashes only.

Parameters
stringinput string
booleantrigger UTF-8 compatibility
Returns
boolean
static valid::alpha_numeric (   $str,
  $utf8 = FALSE 
)
static

Checks whether a string consists of alphabetical characters and numbers only.

Parameters
stringinput string
booleantrigger UTF-8 compatibility
Returns
boolean
static valid::bank_account (   $str)
static

Checks whether string is valid bank account number.

Author
Jan Dubina
Parameters
string$str
Returns
boolean
static valid::byte_size (   $str)
static

Checks whether string is valid byte-string.

Author
Michal Kliment
Parameters
string$str
Returns
boolean
static valid::credit_card (   $number,
  $type = 'default' 
)
static

Validates a credit card number using the Luhn (mod10) formula.

See Also
http://en.wikipedia.org/wiki/Luhn_algorithm
Parameters
integercredit card number
stringcard type
Returns
boolean
static valid::date (   $date = array())
static

Checks whether a array is valid date.

Parameters
array$date
Returns
boolean
static valid::date_string (   $str)
static

Checks whether a string is valid date.

Author
Michal Kliment
Parameters
string$str
Returns
boolean
static valid::digit (   $str,
  $utf8 = FALSE 
)
static

Checks whether a string consists of digits only (no dots or dashes).

Parameters
stringinput string
booleantrigger UTF-8 compatibility
Returns
boolean
static valid::email (   $email)
static

Validate email, commonly used characters only.

Parameters
stringemail address
Returns
boolean
static valid::email_rfc (   $email)
static

Validate email, RFC compliant version Note: This function is LESS strict than valid_email.

Choose carefully.

See Also
Originally by Cal Henderson, modified to fit Kohana syntax standards:
http://www.iamcal.com/publish/articles/php/parsing_email/
http://www.w3.org/Protocols/rfc822/
Parameters
stringemail address
Returns
boolean
static valid::gps_string (   $str)
static

Checks whether string is valid GPS string.

Author
Michal Kliment
Parameters
string$str
Returns
boolean
static valid::ip (   $ip)
static

Validate IP.

Parameters
stringIP address
Returns
boolean
static valid::ip_address (   $str)
static

Checks whether a string is valid IP address.

Author
Michal Kliment
Parameters
string$str
Returns
boolean
static valid::ip_check_subnet (   $ip,
  $net,
  $mask 
)
static

Checks ip address if matches subnet and mask.

Parameters
long$ip
integer$net
integer$mask
Returns
bool
static valid::mac_address (   $str)
static

Checks whether a string is valid MAC address.

Author
Michal Kliment
Parameters
string$str
Returns
boolean
static valid::numeric (   $str)
static

Checks whether a string is a valid number (negative and decimal numbers allowed).

Parameters
stringinput string
Returns
boolean
static valid::phone (   $number)
static

Checks if a czech phone number is valid.

Parameters
stringphone number to check
Returns
boolean
static valid::range (   $number,
  $min = 0,
  $max = 100 
)
static

Checks whether number is included in range.

Author
Jan Dubina
Parameters
type$number
Returns
boolean
static valid::speed_size (   $str)
static

Checks whether string is valid speed size (eg.

in format 2M/8M)

Author
Michal Kliment
Parameters
type$str
Returns
type
static valid::standard_text (   $str)
static

Checks whether a string is a valid text.

Parameters
string$str
Returns
boolean
static valid::suffix (   $str)
static

Checks whether a string is valid URL suffix.

Author
Michal Kliment
Parameters
string$str
Returns
boolean
static valid::ulogd_active_count (   $str)
static

Checks whether a string is valid ulogd active count.

Author
Michal Kliment
Parameters
stringinput string
Returns
boolean
static valid::url (   $url,
  $scheme = 'http' 
)
static

Validate URL.

Parameters
stringURL
stringprotocol
Returns
boolean

The documentation for this class was generated from the following file: