pattern input field code example
Example 1: html input only letters
<!--To stop input from accepting numbers-->
<input onkeypress="return /[a-z]/i.test(event.key)" >
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>';