Users should enter a phone number in international format, it should always start with a +, and without any special chars, so for example +3162503277.
I thought this simple regex would do it, but somehow I must be missing something, because it doesn't accept the phone number:
if (!preg_match('/^\+?[0-9]{6}$/i', $phone))
fail("Invalid phone number");
What should be the way to check if the number starts with a + and further only contains numbers?