Skip to content

Instantly share code, notes, and snippets.

@nielsvr
Created February 22, 2017 08:49
Show Gist options
  • Save nielsvr/329994f83804e2cc00d6765dd3ea9da0 to your computer and use it in GitHub Desktop.
Save nielsvr/329994f83804e2cc00d6765dd3ea9da0 to your computer and use it in GitHub Desktop.
Validate dutch mobile phone numbers (international notation)
<?php
// Validate dutch mobile phone numbers (international notation)
if(!preg_match('/^\+[0-9]{1,2}[ ]\([0-9]{1}\)[ ]([0-9]{9})$/', $telephone)) {
$error = 'Use international notation: +31 (0) 612341234';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment