Skip to content

Instantly share code, notes, and snippets.

@mgng
Last active Dec 28, 2015
Embed
What would you like to do?
preg_match 全角数字通るやつ
<?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