Last active
December 28, 2015 18:09
-
-
Save mgng/7541283 to your computer and use it in GitHub Desktop.
preg_match 全角数字通るやつ
This file contains hidden or 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 | |
var_dump( | |
preg_match( '/\A[\d]+\z/u', '1' ), // int(1) | |
preg_match( '/\A[\d]+\z/u', '1' ), // int(1) | |
preg_match( '/\A[\d]+\z/', '1' ), // int(1) | |
preg_match( '/\A[\d]+\z/', '1' ), // int(0) | |
preg_match( '/\A[0-9]+\z/u', '1' ), // int(1) | |
preg_match( '/\A[0-9]+\z/u', '1'), // int(0) | |
preg_match( '/\A[0-9]+\z/', '1' ), // int(1) | |
preg_match( '/\A[0-9]+\z/', '1' ) // int(0) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment