Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $string = "09/07/2021";
- $padrao = "/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/";
- if(preg_match($padrao, $string)):
- echo "Válido";
- echo "<hr>";
- echo $string;
- else:
- echo "Inválido";
- echo "<hr>";
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement