html input text pattern code example
Example 1: name validation html
<input type="text" pattern="[a-zA-Z'-'\s]*">
Example 2: html5 input pattern name
echo '<input type="text" maxlength="32" name="first_name" pattern="[A-Za-z]{1,32}" value="'.$_SESSION['user_first_name'].'" required>';