SPHPlayground API
SPHPlayground
sphplayground sphplayground

Other validators

Predefined errormessage Template formatting parameters:

  1. :value - the string representation of the validated $value
  2. :type - the datatype of the validated $value
    1. :type = "boolean" - for boolean type
    2. :type = "integer" - for integer type
    3. :type = "float" - for float type
    4. :type = "string" - for string type
    5. :type = "array" - for array type
    6. :type = "object" - for object type
    7. :type = "resource" - for resource type
    8. :type = "resource (closed)" - for closed resource type
    9. :type = "NULL" - for nulls
    10. :type = "unknown type" - for unknown types
  3. :strict-type - the strict datatype of the validated $value differs from :type
    1. any object corresponds to the name of the class get_class() results

The Email validator

The Email validates whether the value is a valid e-mail address. Actual validation uses filter_var() The validation is performed against the addr-spec syntax in » RFC 822. However, comments, whitespace folding, and dotless domain names are not supported, and thus will be rejected. [1]

Warning!

Email validation is complex and the only true way to confirm an email is valid and exists is to send an email to the address.[1]

Synopsis

class Email

The Url validator

The Url validates whether the value is a valid URL. Actual validation uses filter_var() with . It validates whether the URL name is valid according to » RFC 2396. [2]

Warnings:

A valid URL may not specify the HTTP protocol (http://). Therefore, further validation may be required to determine if the URL uses an expected protocol, e.g. ssh:// or mailto:. [2]

This filter only works on ASCII URLs. This means that Internationalized Domain Names (IDN) will always be rejected. [2]

Synopsis

class Url