Created
July 7, 2020 16:54
-
-
Save sae13/9a6f4b6ae52a1c7d6e27ce201eb9bd56 to your computer and use it in GitHub Desktop.
رجکس شماره مبایل
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 | |
$a = "9133917225"; | |
$mobile_pattern = "/^(\s)*(\+98|0098|98|0)?(9\d{9})(\s*|$)/"; | |
preg_match($mobile_pattern,$a,$matches); | |
if(sizeof($matches) === 5) | |
var_dump($matches[3]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment