|
|
@@ -21,14 +21,15 @@ class ReceivedSms extends RestfulController
|
|
|
$data = file(APP_DIR . "/test_msg.txt");
|
|
|
$result = [];
|
|
|
foreach ($data as $datum) {
|
|
|
- $pat = "#\[操作:(.*)\]#iUs";
|
|
|
+ $pat = "#\[(.*)\]-\[IP.*\[操作:(.*)\]#iUs";
|
|
|
preg_match($pat, $datum, $arr);
|
|
|
if ($arr[1]) {
|
|
|
$temp = explode("$$$", $arr[1]);
|
|
|
$result[] = [
|
|
|
'from' => $temp[1],
|
|
|
'to' => $temp[2],
|
|
|
- 'msg' => $temp[0]
|
|
|
+ 'msg' => $temp[0],
|
|
|
+ 'time' => $arr[0]
|
|
|
];
|
|
|
}
|
|
|
|