Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 767 Bytes

NotEmpty.md

File metadata and controls

41 lines (28 loc) · 767 Bytes

NotEmpty

  • v::notEmpty()

Validates if the given input is not empty or in other words is input mandatory and required. This function also takes whitespace into account, use noWhitespace() if no spaces or linebreaks and other whitespace anywhere in the input is desired.

v::string()->notEmpty()->validate(''); //false

Null values are empty:

v::notEmpty()->validate(null); //false

Numbers:

v::int()->notEmpty()->validate(0); //false

Empty arrays:

v::arr()->notEmpty()->validate(array()); //false

Whitespace:

v::string()->notEmpty()->validate('        ');  //false
v::string()->notEmpty()->validate("\t \n \r");  //false

See also: