I am trying to validate an input and the rules (conditions) are:
- The value should be exactly 11 characters long and digit only
- The value should start with
Zero '0'
I have managed to find a solution for rule number one and the code looks like following
$str='01272095631';
if (!preg_match('/^[0-9]{11}+$/', $str)) {$error= "Yes";} else {$error= "No";}
echo $error;
Could you please help me with the rule number 2?