-3
I need to validate this string.
$scop = "ES-1236";
fixed value access key ES-
dynamic 1236
the dynamic being only integer numbers.
to validate I am creating a variable with the search
$lets = "ES-";
and the expression to validate
if(preg_match("/{$lets}/i", $let)) {
echo true;
}
but in this format he is accepting to pass only ES-
but I would like him to force a whole number after the ES-
For the purposes of knowledge. As ES- is not dynamic, you could also use https://www.php.net/manual/en/function.strtok.php. and test if the result is a number
– Marcos Xavier