1 Star 0 Fork 2

且听风吟/cliprobe_curl

forked from Jackey870/cliprobe_curl 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
data_ibeacon.php 2.63 KB
一键复制 编辑 原始数据 按行查看 历史
贝壳汉木 提交于 2016-10-10 18:22 . 优化IBeacon数据显示
<?php include "view/nav.php" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>收集数据查看</title>
<link rel="stylesheet" href="view/static/theme.css" type="text/css">
</head>
<div class="header">
<h3>收集数据查看</h3>
<?php echo $nav; ?>
</div>
<div class="main-content">
<div class="data-content">
<b>IBeacon数据</b>
<hr>
<?php
require "config.php";
function readLastLinesOfFile($filePath, $lines = 10)
{
// echo "<h3> 文件位置: " . $filePath . "</h3>";
//global $fsize;
$handle = fopen($filePath, "r");
if (!$handle) {
return array();
}
$linecounter = $lines;
$pos = -2;
$beginning = false;
$text = array();
while ($linecounter > 0) {
$t = " ";
while ($t != "\n") {
if (fseek($handle, $pos, SEEK_END) == -1) {
$beginning = true;
break;
}
$t = fgetc($handle);
$pos--;
}
$linecounter--;
if ($beginning) {
rewind($handle);
}
$text[$lines - $linecounter - 1] = str_replace(array("\r", "\n"), '', fgets($handle));
if ($beginning) {
break;
}
}
fclose($handle);
return array_reverse($text);
}
// $client_file_path = './data/client_data.txt';
date_default_timezone_set('PRC');
$client_file_path = './data/ibeacon_data.txt';
if(file_exists($client_file_path))
{
$content_arr = readLastLinesOfFile($client_file_path, 200);
$content_arr = array_reverse($content_arr);
$content_str = '';
foreach($content_arr as $item)
{
$item_arr = explode(chr(9), $item);
$item_html = implode("&nbsp;&nbsp;&nbsp;&nbsp;", $item_arr);
$content_str .= $item_html.'</br>';
}
echo $content_str;
}
else
{
echo '没有数据!';
}
?>
</div>
</div>
<body>
</body>
<script type="text/javascript" src="//cdn.bootcss.com/jquery/2.2.1/jquery.js"></script>
<script type="text/javascript">
</script>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/qtfy2020/cliprobe_curl.git
[email protected]:qtfy2020/cliprobe_curl.git
qtfy2020
cliprobe_curl
cliprobe_curl
master

搜索帮助