Ai
1 Star 2 Fork 0

何欢/php处理抓包数据

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
processData.php 923 Bytes
一键复制 编辑 原始数据 按行查看 历史
何欢 提交于 2022-09-22 16:16 +08:00 . 优化
<?php
$files = scandir('./resource');
echo "======== start ========" . PHP_EOL;
foreach($files as $file) {
if ($file == '.' || $file == '..') {
continue;
}
echo './resource/' . $file . PHP_EOL;
$file_content = file_get_contents('./resource/'. $file);
$request_arr = explode('------------------------------------------------------------------', $file_content);
$data = [];
foreach($request_arr as $reqeust) {
$reqeust = trim($reqeust);
if (!$reqeust) {
continue;
}
$tmp_arr = explode("\n", $reqeust);
if (!isset($tmp_arr[0]) || !$tmp_arr[0]) {
continue;
}
$data[] = [
'url' => $tmp_arr[0],
'data' => json_decode(end($tmp_arr), true)
];
}
file_put_contents('./result/' . $file, json_encode($data, JSON_UNESCAPED_UNICODE));
}
echo "======== done ========";
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/giteuan/processing-packet-capture-data.git
git@gitee.com:giteuan/processing-packet-capture-data.git
giteuan
processing-packet-capture-data
php处理抓包数据
master

搜索帮助