php获取机器运行的时间, 获取文本的内容
来源:互联网 发布:飞利浦显示器调节软件 编辑:程序博客网 时间:2024/06/10 06:21
function get_dev_run_time() { system("uptime > /var/uptime"); $file = fopen('/var/uptime', 'r'); if ($file) { $buffer = fgets($file, 1024); $str = explode(',', $buffer); $str1 = strstr($str[0], "day", true); if ($str1 != false) { $str2 = strstr($str1, "up", false); $days = substr($str2, 2); $str3 = strstr($str[1], "min", true); if ($str3 != false) { $hours = 0; $mins = $str3; } else { $str4 = explode(':', $str[1]); $hours = $str4[0]; $mins = $str4[1]; } } else { $days = 0; $str2 = strstr($str[0], "min", true); if ($str2 != false) { $hours = 0; $str3 = strstr($str2, "up", false); $mins = substr($str3, 2); } else { $str3 = strstr($str[0], "up", false); $time = substr($str3, 2); $str4 = explode(':', $time); $hours = $str4[0]; $mins = $str4[1]; } } fclose($file); } $format_time = $days."天".$hours."小时".$mins."分钟"; return $format_time;}
0 0
- php获取机器运行的时间, 获取文本的内容
- 获取静态文本的内容
- php获取超链接文本内容的几款正则表达式
- 获取时间的一些内容
- 获取Spinner当前显示的文本内容
- 获取a元素的文本内容
- jquery获取文本编辑器的内容
- 获取WebView里的网页文本内容
- iOS 获取文本内容的高度
- 获取文本节点内容(nodeValue)的方法。
- unity中获取button文本的内容
- php 时间月份的获取
- 无法获取 的内部内容,因为该内容不是文本
- PHP获取PHP执行的时间
- 获取VC/MFC程序的运行时间
- C++ 关于进程运行时间的获取
- 获取系统运行的时间,单位毫秒
- Linux C获取系统的运行时间
- sql cte
- CentOS7 mysql 安装
- 面试3
- 腾讯云CentOS 6.3 环境(apache+php+mysql)搭建
- boot表单对勾错误样式,固定定位,登录表单
- php获取机器运行的时间, 获取文本的内容
- 5.3 JLL 实习日志
- 使用Java完成网上支付(1. 银联)
- Android 5.0新控件 TextInputLayout | 文字输入布局 介绍及使用详情
- 直连网、交叉网、千兆网线顺序
- SpringMVC中注解的继承
- CentOS 7搭建SVN服务器
- 面试题之基础知识
- git版本上传