Created
December 6, 2013 13:52
-
-
Save joubertredrat/7824139 to your computer and use it in GitHub Desktop.
Desse jeito funciona
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = '[0710:020602938:7041]'; | |
switch(true) { | |
case preg_match('/^(\[)[A-Z0-9]{4}:(' . rand(10000,29999) . '|' . rand(50000,99999) . '):[A-z]{3}(\])(.*)+/', $str); | |
echo 'a'; | |
break; | |
case preg_match('/^(\[)[A-Z0-9]{4}:[0-9]{9}:[0-9]{4}(\])+/', $str); | |
echo 'b'; | |
break; | |
default: | |
echo 'c'; | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment