-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.php
More file actions
33 lines (32 loc) · 831 Bytes
/
user.php
File metadata and controls
33 lines (32 loc) · 831 Bytes
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
<?php
$content = file_get_contents('07.txt');
$content = str_replace(array("\r\n", "\r", "\n"), "####", $content);
$content = explode('####', $content);
if ($content) {
foreach ($content as $item) {
if ($item) {
$con = explode('=', $item);
if (count($con)>1) {
$contents[] =$con[1];
}
}
}
}
echo "共计有".count($contents)."用户";
$res=[];
if ($contents) {
foreach ($contents as $content) {
$content = trim($content);
$endString = substr($content, strlen($content) - 1);
if (array_key_exists($endString, $res)) {
$res[$endString]= $res[$endString]+1;
} else {
$res[$endString] =1;
}
}
}
echo '</br>';
echo "用户的分析";
echo '</br><pre>';
arsort($res);
var_dump($res);die;