ectouch手机模板出现(Notice: Undefined offset: 1)错误
发布网友
发布时间:2022-12-14 04:13
我来回答
共2个回答
热心网友
时间:2023-09-28 21:22
$db_config这个数组第二空值,本地测试的话,$config['DB_PORT'] =3306,就可以了,或者说,你找上流,有个地址的赋值的变量,加“:3306”,也是OK的
热心网友
时间:2023-09-28 21:22
<?php
function get_hardware_cpu() {
$cpu_info = array();
$cpu_num = -1;
$data = file('cpuinfo.txt');
foreach($data as $k=>$line){
list($name,$value) = preg_split("/\s+:\s+/",trim($line));
if (!(isset($name) && strlen(trim($name))) > 0) continue;
if ($name == "processor") {
$cpu_num++;
} else {
$cpu_info[$cpu_num][$name] = $value;
}
}
return $cpu_info;
}
$arr_cpuinfo = get_hardware_cpu();
echo "<pre>";
print_r($arr_cpuinfo);
echo "</pre>";
?>
=============================
那个警告提示是说分割出来的数组,最后一个元素没有值
我把这个cpuinfo文件从虚拟机里拿到windows中,删除最后一行就好了。不报任何警告
processor : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 6
model name : AMD Athlon(tm) II X2 255 Processor
stepping : 3
cpu MHz : 3092.319
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow constant_tsc up tsc_reliable nonstop_tsc unfair_spinlock pni cx16 popcnt hypervisor lahf_lm extapic abm sse4a misalignsse 3dnowprefetch osvw
bogomips : 6184.63
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
就是下面这一行惹的祸
power management:
11111.png (25.75 KB)
2014-4-27 23:22