检查变量是否包含姓氏和姓氏中的至少一位数字

I would like to check if at least a digit was inserted after the first name in this input.

So, if the user input 'joe' it will not validate, but 'joe d' or 'joe doe' it will pass.

How can this be done?

$nome = $this->coalesce($form['nome']);
if (strlen($nome) > 0)
    $this->setValue('nome', strtoupper($nome));
else
    $this->addError('nome', 'Invalid name!');

You can use a regex to do this:

if( preg_match( '/\w+ \w+/', $name)) {
    echo "Validation passes!";
} else { 
    echo "Invalid input";
}

You can change the regex to '/[A-Za-z]+ [A-Za-z]+/', since \w will match more than just alphabetic characters (it includes numbers and underscores).

Something like the following should do it:

if(!preg_match('/[a-z]+\s+[a-z]+/i', $nome)) {
    $this->addError('nome', 'Invalid name!');
}

This will validate names that consist of a string of alphabetic characters, followed by a space then another alphabetic string.