后端开发2023年05月18日
PHP判断mysql数据库中指定的表名及字段名是否存在 查询表名:select COUNT(*) from information_schema.tables WHERE table_name = '表名'; 查询字段:select COUNT(*) from information_schema.columns WHERE table_name = '表名...
后端开发2023年05月15日
PHP通过数组判断指定的字符串是否在多个字符串数组中有匹配。 <?php $people = array("Bill", "Steve", "Mark", "David", "九品源码", "mdaima"); if (in_array("Mark", $people)) { echo "匹配已找到"; } else { echo "匹配未找到"; }...
后端开发2023年05月14日
1、判断是否是手机端 function isMobile() { // 如果有HTTP_X_WAP_PROFILE则一定是移动设备 if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) { return true; } // 如果via信息含有wap则一定是移动设备,部分服务商会屏蔽该信息 if (isset($_SERVER...
后端开发2023年05月07日
$path_name="out_zip/web_abc.zip"; if (file_exists($path_name)){//判断文件如果存在 unlink($path_name);//删除文件 fopen($path...
后端开发2023年05月06日
如果图片是空的或是不存在则用指定的替换if ($img=='' || !file_exists($img) ){ $img="/sc/touxiang.png"; }...
后端开发2023年05月06日
字符串截取:if ($keyword_str!=''){ echo substr($keyword_str,0,-1);//去掉最后一位 }判断指定字符串是否存在:if (strpos($dh_url,"/jingyan")!==false){ $class_2='class=&quo...
前端开发2023年05月05日
.abc{ height:300px; border:1px solid #000; margin:0 auto} @media screen and (min-width: 1201px) { &nb...
前端开发2023年05月04日
var isFocus=$("#saomiaoma").is(":focus"); if(isFocus==true){ console.log('获取到了焦点') }else{ console.l...
前端开发2023年05月04日
<input name="zc_code" id="zc_code" type="text" value="" class="zc_code" maxlength="15"/...
前端开发2023年05月03日
if ($(".img_guige").eq(0).length > 0){//元素存在 var first_height=$(".img_guige").eq(0).css("height");//获取第一个元素的...