Created
May 17, 2019 04:19
-
-
Save savepong/ef52d927792e47fa11789ad5f12d912e to your computer and use it in GitHub Desktop.
เช็คว่ามีเป็นตัวเลขใน string หรือไม่? และมีกี่ตัว?
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
$str = '183293819203'; | |
preg_match_all('!\d!', $str, $numbers); | |
dd( count($numbers[0])==13 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment