I have a problem of a single input that has to have two names of a person input. Validating the name input to be of letters worked okay like it is shown here:
if(!preg_match("/^[a-zA-Z'-]+$/", $_POST['name'] )){
echo 'name must be letters';
}
That will only validate a single name eg: John. But what I need is to validate the that the string contains two words. Like James Doe
This is the form input:
<input autofocus id="aum" name="name" placeholder="John Doe" type="text" />