5. Check methods - adwins/Arrayer GitHub Wiki

5. Check methods.

Introduction

Check methods.

Details

/**
 * Checks if the value is empty
 */
boolean $arrayer->var->is_empty();

/**
 * Checks if the value is string
 */
boolean $arrayer->var->is_string();

/**
 * Checks if the value is equal to given $value
 */
boolean $arrayer->var->is($value);

/**
 * Checks if the value is valid URL
 */
boolean $arrayer->var->is_url();

/**
 * Checks if the value is valid email
 */
boolean $arrayer->var->is_email([ $check_mx = false ]);

/**
 * Checks if the value is valid phone
 */
boolean $arrayer->var->is_phone([ $clean = false [, $ccode = self::COUNTRY_CODE ]);

/**
 * Checks if the value is valid date
 */
boolean $arrayer->var->is_date([ $clean = false [, $to_format = 'Y-m-d' ]);

/**
 * Checks if the value is integer
 */
boolean $arrayer->var->is_int();

/**
 * Checks if the value is in given array
 */
boolean $arrayer->var->in(mixed $value [, mixed $value [, ... ] ]);

/**
 * Checks if the value is between 10 and 90
 */
boolean $arrayer->var->in_range(10, 90);

/**
 * Checks if the value has $length
 */
boolean $arrayer->var->has_length($length [, $charset = self::CHARSET ]);

/**
 * Checks if the value length is between $min and $max
 */
boolean $arrayer->var->has_length_between($min, $max [, $charset = self::CHARSET ]);

/**
 * Checks if the value matches PRCE $pattern
 */
boolean $arrayer->var->matches($pattern [, $return_matches = false ]);

array $arrayer->var->matches($pattern, true);

/**
 * Checks if the value contains $needle
 */
boolean $arrayer->var->contains($needle);

/**
 * Checks if the value starts with $needle
 */
boolean $arrayer->var->starts_with($needle);

/**
 * Checks if the value ends with $needle
 */
boolean $arrayer->var->ends_with($needle);



⚠️ **GitHub.com Fallback** ⚠️