Windows10禁止自动安装显卡驱动
换过显卡的A1286安装Windows10后遇到的问题,联网自动安装显卡驱动后系统死机重启,进入安全模式卸载显卡驱动后恢复正常,但系统会再次自动安装。
按Win
+R
打开运行,输入gpedit.msc
打开组策略编辑器
从左侧依次打开:计算机配置 -> 管理模板 -> Windows 组件 -> Windows 更新(此项双击打开),再从右侧列表中找到Windows更新不包括驱动程序
,双击打开,选择"已启用"并确定。
换过显卡的A1286安装Windows10后遇到的问题,联网自动安装显卡驱动后系统死机重启,进入安全模式卸载显卡驱动后恢复正常,但系统会再次自动安装。
按Win
+R
打开运行,输入gpedit.msc
打开组策略编辑器
从左侧依次打开:计算机配置 -> 管理模板 -> Windows 组件 -> Windows 更新(此项双击打开),再从右侧列表中找到Windows更新不包括驱动程序
,双击打开,选择"已启用"并确定。
可使用array_merge()
函数或array_merge_recursive()
函数。
两函数用法相同,均为将多个数组作为参数传入,如:array_merge($arr1, $arr2, $arr3, $arr4)
。
区别在于array_merge()
函数键值冲突时后面的会覆盖前面的,array_merge_recursive()
函数键值冲突时会将冲突部分合并为新数组。
举个例子:
<?php
$arr1 = ['a'=>1, 'b'=>2];
$arr2 = ['b'=>3, 'c'=>4];
print_r(array_merge($arr1, $arr2));
//结果为:Array([a] => 1 [b] => 3 [c] => 4)
print_r(array_merge_recursive($arr1, $arr2));
//结果为:Array([a] => 1 [b] => Array([0] => 2 [1] => 3) [c] => 4)
print_r(array_merge([0, 1, 2], [0, 1, 2]));
//结果为:Array([0] => 0 [1] => 1 [2] => 2 [3] => 0 [4] => 1 [5] => 2)
break与continue语句均可用于跳出循环,区别在于:
continue跳出本次循环,但此循环语句会继续。
break跳出此循环语句,但外面嵌套(如果有)的循环语句仍然会继续。
举个例子:
<?php
$arr = [0, 1, 2, 3];
foreach($arr as $row){
foreach($arr as $num){
if($num === 2){
break;
}else{
echo $num;
}
}
}
//输出结果为:01010101
foreach($arr as $row){
foreach($arr as $num){
if($num === 2){
continue;
}else{
echo $num;
}
}
}
//输出结果为:013013013013
使用函数如下:ucwords()
:将每个单词首字母转换为大写。ucfirst()
:将第一个单词首字母转为大写。lcfirst()
:将第一个单词首字母转为小写。strtoupper()
:将所有字母转为大写。strtolower()
:将所有字母转为小写。
echo ucwords("hello world");
//Hello World
echo ucfirst("hello world");
//Hello world
echo lcfirst("HELLO WORLD");
//hELLO WORLD
echo strtoupper("hello world");
//HELLO WORLD
echo strtolower("HELLO WORLD");
//hello world
使用class_exists()
函数,参数为类名,如果有命名空间要注意需要完整的命名空间。
举个例子:
检测代码:
<?php
$obj = new path\class_a;
//会实例化成功
$obj = new base\path\class_a;
//会报错:未定义类 "base\base\path\class_a"
var_dump(class_exists('base\path\class_a'));
//使用完整的命名空间,结果为True
var_dump(class_exists('path\class_a'));
//未使用完整的命名空间,结果为False
被检测类:
<?php
namespace base\path;
class class_a{}