Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //regular
- $datefilter = "/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/";
- $numberfilter = "/^([0-9])/";
- $emailfilter = "/^.+\.com$/";
- $usernamefilter = "/^([a-zA-Z]+)([a-zA-Z0-9_\-]{5,32})+$/";
- $idcardfilter = "/^([0-9]{13,13})/";
- $filter = "/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/";
- $mfilter = "/^0([8-9]{1})([0-9]{1})([0-9]{3})([0-9]{4})$/";
- $thfilter = "/^([^a-zA-Z0-9_\.\@\-\%])/";
- $passwordfilter = "/^([a-zA-Z0-9_\.\-\@\%]{8,32})+$/";
- //Start demo
- $booleanx = preg_match($filter_th,"ดำำำำำfaaaaaa", $matches_out);
- echo $booleanx;
- echo "<p/>";
- foreach ($matches_out as $key => $value) {
- $key = utf8_encode($key);
- $value = utf8_encode($value);
- echo "<br/>".$key." => ".$value;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement