-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.php
More file actions
61 lines (54 loc) · 1.13 KB
/
Example.php
File metadata and controls
61 lines (54 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* 方法调用示例
*
* Class Example
*/
class Example extends Tools
{
/**
* 微信环境测试
*/
public function test1()
{
$result = $this->isWechatEnv();
print_r($result);
}
/**
* 获取微信内置浏览器版本号
*/
public function test2()
{
$result = $this->getWechatVersion();
print_r($result);
}
/**
* 获取用户访问页面所用的手机设备类型
*/
public function test3()
{
$result = $this->getDeviceType();
print_r($result);
}
/**
* 手机号码合法性验证
*/
public function test4()
{
$phone1 = '13612345678';
$phone2 = '19900000000';
$result1 = $this->isMobile($phone1);
$result2 = $this->isMobile($phone2);
print_r($result1);
print_r($result2);
}
/**
* 身份证号合法性验证
*/
public function test5()
{
$id_card_example = '542500198802109261'; //号码来自于网络
$result = $this->validationFilterIdCard($id_card_example);
print_r($result);
}
}