2.4. M2_Validate

All static methods on the M2_Validate object return TRUE if the test passes and FALSE if not.

M2_Validate::email($email)

Takes email validation one step further and verifies that the domain of the email has a valid DNS entry.

M2_Validate::mobile($number)

Validates the country code and number of digits against a mobile number profile database in Moski2.net. This is by no means complete, so please let us know if you need support for countries not in the list.

$number must contain the country code including a leading plus sign.

Currently we support validation of mobile numbers from these countries:

  • Belgium

  • Denmark

  • Faroe Islands

  • Finland

  • France

  • Germany

  • Great Britain

  • Iceland

  • Latvia

  • Malaysia

  • Norway

  • Poland

  • Portugal

  • Saudi Arabia

  • Sweden

  • Switzerland

  • United Arab Emirates

  • USA