PAN abbreviated as Permanent account number is a unique 10 digit alphanumeric number issued by Income Tax Department to Indian taxpayers. ex: ABCTY1234D.
Here we will validate the PAN format from the input field using the PHP.
if (preg_match("/[A-Z]{5}[0-9]{4}[A-Z]{1}/", $pannumber)) {
echo "Valid PAN number";
}
else{
echo "Invalid PAN number";
}