Conditions | 6 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
11 | public static function maskIsValidate($number, $mask) |
||
12 | { |
||
13 | $i = 0; |
||
14 | $maskLen = strlen($mask); |
||
15 | $numberLen = strlen($number); |
||
16 | if ($maskLen !== $numberLen) { |
||
17 | return false; |
||
18 | } |
||
19 | while($i < $maskLen) { |
||
20 | if (strtoupper($mask[$i])!=='X' && strtoupper($mask[$i])!=='#') { |
||
21 | if ($mask[$i]!==$number[$i]) { |
||
22 | return false; |
||
23 | } |
||
24 | } |
||
25 | $i = $i + 1; |
||
26 | } |
||
27 | return true; |
||
28 | } |
||
30 | } |