叶测试 发布的文章
ThinkPHP使用PHPExcel出现:Class 'Admin\Action\PHPExcel_IOFactory' not found
使用TP3.2.3的PHPExcel在做excel的导入和导出,本地wamp测试正常,上传服务器出现问题出现个错误:Class 'Admin\Action\PHPExcel_IOFactory' not found
PHP获取服务器的mac地址类
<?php
/**
* 获取网卡的MAC地址,目前支持WIN/LINUX系统
* 获取机器网卡的物理(MAC)地址
*/
class getMacAddr{
var $return_array = array();
var $mac_addr;
function getMacAddr($os_type){
switch (strtolower($os_type)) {
case 'linux':
$this->forLinux();
break;
case 'solaris':
break;
case 'unix':
break;
case 'aix':
break;
default:
$this->forWindows();
break;
}
$temp_array = array();
foreach ($this->return_array as $value) {
if(preg_match("/[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f]/i", $value, $temp_array)){
$this->mac_addr = $temp_array[0];
break;
}
}
unset($temp_array);
return $this->mac_addr;
}
function forWindows(){
@exec("ipconfig /all", $this->return_array);
if($this->return_array){
return $this->return_array;
}else{
$ipconfig = $_SERVER["WINDIR"]."\system32\ipconfig.exe";
if(is_file($ipconfig)){
@exec($ipconfig." /all", $this->return_array);
}else{
@exec($_SERVER["WINDIR"]."\system\ipconfig.exe /all", $this->return_array);
}
return $this->return_array;
}
}
function forLinux(){
@exec("ifconfig -a", $this->return_array);
return $this->return_array;
}
}
//方法使用
$mac = new getMacAddr(PHP_OS);
echo $mac->mac_addr;
?>
cURL实现Get和Post请求的方法
private function https_request($url, $data = null){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
if (!empty($data)){
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($curl);
curl_close($curl);
return $output;
}
echarts异步加载多图表切换样式不更新
异步获取多图表时,仅有数据及坐标轴更新,样式无法更新。查看api手册,使用clear方法清除即可。(清空当前实例,会移除实例中所有的组件和图表。清空后调用 getOption 方法返回一个{}空对象。)
作为程序员的我看完《你的名字》之后成了单身狗
本文作者 水煮娱
大家好,我是一名正直的程序员&游戏玩家。昨天陪同女朋友看了一遍《你的名字。》。现在我很委屈,要借这个平台发泄一下,好的我要开始了。
昨天,她在电影院里全神贯注,非常感动,哭得稀里哗啦,急得我从纸巾手绢一直掏到了卫生巾。而我终于等到这个充满bug的故事结束。内心暗骂:数死早!娘希匹。!
jQuery给动态添加的元素绑定事件的方法
jquery 1.7版以前使用live动态绑定事件。
$("#testdiv ul li").live("click",function(){...});
jquery 1.7版以后使用on动态绑定事件
$("#testdiv ul").on("click","li", function() { ... });
WIN7如何删掉桌面上的IE图标
- 在注册表里面依次找到
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace
- 【文件】—【导出】备份注册表
- 使用记事本打开刚刚保存的注册表,【CTRL+F】查找,输入【Internet
Explorer】,找到相应的项目。注意到此时的文件名编号是{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B - 在注册表编辑器中找到原先查找的IE的注册信息的那个文件名。右击删除文件,刷新一下桌面,这时候IE图标就会消失了。