\um\coreValidation

Class Validation

Summary

Methods
Properties
Constants
__construct()
remove_html()
normalize()
safe_name_in_url()
strong_pass()
safe_username()
safe_string()
is_phone_number()
is_url()
randomize()
generate()
random_number()
validate_date()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

Validation constructor.

remove_html()

remove_html(  $string) : string

Removes html from any string

Parameters

$string

Returns

string

normalize()

normalize(  $string) : mixed

Normalize a string

Parameters

$string

Returns

mixed

safe_name_in_url()

safe_name_in_url(  $name) : mixed|string

Safe name usage ( for url purposes )

Parameters

$name

Returns

mixed|string

strong_pass()

strong_pass(  $candidate) : boolean

Password test

Parameters

$candidate

Returns

boolean

safe_username()

safe_username(  $string) : boolean

Space, dash, underscore

Parameters

$string

Returns

boolean

safe_string()

safe_string(  $string) : boolean

Dash and underscore (metakey)

Parameters

$string

Returns

boolean

is_phone_number()

is_phone_number(  $string) : boolean

Ss phone number

Parameters

$string

Returns

boolean

is_url()

is_url(  $url, boolean  $social = false) : boolean

Is url

Parameters

$url
boolean $social

Returns

boolean

randomize()

randomize(integer  $length = 10) : string

Get a random string

Parameters

integer $length

Returns

string

generate()

generate(integer  $length = 40) : string

Generate a password, hash, or similar

Parameters

integer $length

Returns

string

random_number()

random_number(boolean  $len = false) : integer|string

Random numbers only

Parameters

boolean $len

Returns

integer|string

validate_date()

validate_date(  $date, string  $format = 'YYYY/MM/D') : boolean

To validate given date input

Parameters

$date
string $format

Returns

boolean