阿里云跨地域跨账号数据盘恢复
要把A账号中北京地域ECS的数据库盘恢到B账号中香港地域的ECS
1、云服务器ECS》存储与快照》快照,创建快照
2、新快照,操作》复制快照,此时可以选择要复制到哪个地域
3、切换到香港地域,找到新复制的快照》操作》更多操作》共享快照,共享给B账号
4、登录B账号,进入资源管理》资源共享》共享给我的》接受A账号的共享申请
5、在B账号ECS》存储与快照》块存储》创建云盘》用快照创建云盘,创建云盘同时挂载到ECS,此时可以选择A账号共享的快照
跨地域跨账号数据盘恢得完成!
WINDOWS11激活
请输入查看密码:layui.layer宽度自适应
maxWidth当area属性为auto时有效
layer.open({
skin: 'layui-layer-admin',
title:"弹层标题",
type: 1,
maxmin: true,
area: ['auto','90%'],
maxWidth:1200,
shadeClose: true,
content: html
});
设置百分比宽度,打开弹层后重置最大宽度(高度)和位置,实现宽度自适应
layer.open({
skin: 'layui-layer-admin',
title:'标题',
type: 1,
maxmin: true,
area: ['90%','90%'],
shadeClose: true,
content: html,
success:function(layero,index,that){
layer.style(index,{maxWidth:1200});
//layer.style(index,{maxWidth:1200, maxHeight:800});
that.offset();
}
});高度自适应
layer.open({
skin: 'layui-layer-admin',
title:'标题',
type: 1,
maxmin: true,
area: ['90%','90%'],
shadeClose: true,
content: html,
success:function(layero,index,that){
layer.iframeAuto(index); // 让 iframe 高度自适应
that.offset();
}
});PHP getimagesize函数和image_type_to_extension函数
获取图片尺寸
getimagesize($image_path)
Array(
[0] => 256 //宽
[1] => 256 //高
[2] => 3 //IMAGETYPE常量,代表某种图片类型
[3] => width="256" height="256"
[bits] => 8
[mime] => image/png
)
根据 getimagesize() 返回的 IMAGETYPE常量 获取图片类型(扩展名)
image_type_to_extension(IMAGETYPE常量)
没有匹配结果时返回 false
1: .gif 2: .jpeg 3: .png 4: .swf 5: .psd 6: .bmp 7: .tiff 8: .tiff 9: .jpc 10: .jp2 11: .jpx 12: .jb2 13: .swf 14: .iff 15: .bmp 16: .xbm 17: .ico 18: .webp
apifox.com之通过JSON Schema设置数组类型的复杂form_data参数
{
"type": "array",
"items": {
"type": "object",
"properties": {
"goods_type": {
"type": "string",
"title": "材料类型",
"enum": [
"material",
"semifinished"
],
"x-apifox": {
"enumDescriptions": {
"material": "原料",
"semifinished": "原料型产品"
}
}
},
"goods_classid": {
"type": "integer",
"title": "材料类别id"
},
"goods_name": {
"type": "string",
"title": "材料名称",
"description": "仅原料型产品有"
},
"goods_weight": {
"type": "number",
"title": "材料重量",
"description": "最多三位小数,单位:t"
}
},
"required": [
"goods_type",
"goods_classid",
"goods_weight"
],
"x-apifox-orders": [
"goods_type",
"goods_classid",
"goods_name",
"goods_weight"
]
}
}
PHP try...catch无效的原因及解决办法
来源:百度文心一言
在PHP中,try-catch块主要用于捕获和处理异常(Exceptions),而不是用于捕获和处理警告(Warnings)或通知(Notices)。警告和通知是PHP的错误报告机制的一部分,它们指示代码中存在潜在的问题,但通常不会阻止脚本的执行。
如果你的PHP代码中的try-catch块看起来没有按预期工作,并且直接显示了警告(Warning),这通常意味着:
1. 抛出的不是异常:你的代码可能在try块中产生了警告,而不是抛出了一个异常。警告不会自动被catch块捕获。
2. 异常未被正确抛出:如果你预期某个函数或操作会抛出异常,但实际上它没有抛出(可能因为某些条件未满足),那么catch块也不会捕获任何内容。
解决方案
1. 检查错误类型:
确保在try块中发生的是异常(Exception)而不是警告(Warning)或通知(Notice)。
如果你想处理警告或通知,你可能需要调整PHP的错误报告级别,或者使用其他机制(如错误处理函数set_error_handler())来捕获这些错误。
2. 正确抛出异常:
确保在try块中的代码在遇到问题时能够抛出异常。
如果你的代码依赖于第三方库或框架中的函数来抛出异常,请确保该函数在失败时确实会抛出异常。
3. 使用错误处理函数:
如果需要捕获警告或通知,你可以使用set_error_handler()函数来设置一个自定义的错误处理函数。这个函数可以捕获错误,并可以根据需要抛出异常。
set_error_handler(function($severity, $message, $file, $line) {
if (!(error_reporting() & $severity)){
// This error code is not included in error_reporting
return;
}
throw new ErrorException($message, 0, $severity, $file, $line);
});
$arr=array('a');
try{
trim($arr);
}catch(Exception $e) {
echo var_export($e,true);
echo $e->getMessage(), $e->getFile();
}
4. 检查PHP错误报告设置:确保你的PHP配置(php.ini)或运行时配置中的错误报告设置符合你的需求。你可以通过error_reporting()函数来动态调整错误报告级别。
获取微信公众号关注地址
来源:https://blog.csdn.net/weixin_42645230/article/details/114372624 第一步:将微信公众号的任意一篇推文链接复制出来,在浏览器中打开 第二步: 按住F12(window系统)打开代码审查 ,将代码全部复制出来放到一个新建的txt文件,全局搜索__biz,将后面跟的参数复制下来 第三步:将第二步获取的__biz参数放到下面位置 ,该链接即为关注页面的链接 本文发布于 2021-03-04 亲测有效 https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=这里第二步拿到的参数&scene=110#wechat_redirect
使用下面链接也可以: 20240717测试有效
https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=参数#wechat_redirect
用jQuery对html转义字符进行反转义
$('<div></div>').html(转义后的html).text();
