I have an input box where user can enter their domain. I want to make sure the domain should be like that:
example.com
hello.com
okay.com
NOT
I mean no http, https and www at the beginning of the domain.
So far I got this:
} elseif( !preg_match('/^[a-zA-Z. ]+$/', $domain) ) {
$output['message'][] = 'Your domain should be start with http, https or www but can contain (.)com';
}
How can I improve this preg_match function to get the desire validation?