自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

原创 mermaid测试

流程图sequenceDiagramA->> B: QueryB->> C: Forward queryNote right of C: Thinking…C->> B: ResponseB->> A: Forward response甘特图ganttdateFormat YYYY-MM-DDtitle Shop项目交付计划section 里程碑 0.1数据库设计 :active, p1, 2016-08-15

2022-04-02 15:29:12 800

原创 Apache如何解决跨域资源访问

找到配置文件 httpd.conf#LoadModule headers_module modules/mod_headers.so去掉#注释(开启apache头信息自定义模块)配置文件 httpd.conf大概295行,改为 Require all granted如果项目里有.htaccess文件放入这段代码<IfModule mod_headers.c&gt...

2019-09-20 10:49:03 4177

原创 confirm确认删除跳转后避免链接输出

修改前:点击确认,执行时会把http://baidu.com输出<a href='javascript:if(confirm("删除后将无法恢复数据 确认删除?")==true){window.location.href="http://baidu.com";}'>删除</a>修改后:正确写法<a href='http://baidu.com' onc...

2019-09-10 10:50:59 619

原创 get/post/curl/curl_multi_*并发请求

//get/post请求$opts = array( 'http'=>array( 'method'=>"GET", 'timeout'=>5,//单位秒 ));$opts = array( 'http'=>array( 'method'=>"POST", 'header'=>"Content-type: appl

2018-01-17 17:56:14 617

转载 46 个非常有用的 PHP 代码片段

https://www.oschina.net/question/2012764_246023

2017-11-13 17:02:01 201

原创 抓取远程图片保存到本地

$url = ‘http://tieba.baidu.com/f?kw=%E5%A5%BD%E5%90%AC%E7%9A%84%E6%AD%8C‘; result=filegetcontents(result = file_get_contents(url); preg_match_all(“/

2017-05-19 10:13:45 2007

转载 JS验证URL函数 正则(全)

http://www.jb51.net/article/31550.htm

2017-02-07 11:32:32 8415

原创 PHP过滤重复的值

function assoc_unique($arr, $key) { $tmp_arr = array(); foreach($arr as $k => $v) { if(in_array($v[$key], $tmp_arr)) { unset($arr[$k]); } else {

2016-03-17 15:51:51 926

转载 点击Ctrl+Enter提交

<script type="text/javascript">var isIE = navigator.userAgent.indexOf("MSIE")>0;/*** @deprecated onkeydown function* @param{obj} object**/function KeyDown(obj){obj.onkeydown = function(e){

2016-03-17 15:49:45 561

转载 限制图片大小

function CheckImg(img){ var MaxWidth=400;//设置图片宽度界限 var MaxHeight=400;//设置图片高度界限 var HeightWidth=img.offsetHeight/img.offsetWidth;//设置高宽比 var WidthHeight=img.offsetWidth/img.offsetHeight;//设置宽高

2016-03-17 15:48:48 295

原创 限制字数(半角全角)

<script type="text/javascript"> function checkLength() { var which = $("#content").val();var totalLength = 0;var maxChars = 140; var list = which.split("");//if (list.length > maxChars) //list.v

2016-03-17 15:46:59 432

转载 js-全选

function selectAll(){obj=document.getElementsByName('check');for(var i=0;i<obj.length;i++){if(obj.item(i).checked == true){obj.item(i).checked = false;}else{obj.item(i).checked = true;}}}

2016-03-17 15:45:28 191

转载 判断复选框是否被选中

function check(){ var obj=document.getElementsByName('check'); var uid=''; for(var i=0; i<obj.length; i++){ if(obj[i].checked) uid+=obj[i].value+','; } if(uid == '') { alert('

2016-03-17 15:44:38 413

原创 分享帖子到腾讯、新浪微博

1.<!--百度分享按钮--><div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare"><a class="bds_qzone" title="分享到QQ空间">QQ空间</a><a class="bds_tsina" title="分享到新浪微博">新浪微博</a><a class="bds_tqq" title="分享到腾讯微

2016-03-17 15:43:42 463

转载 循环日期

$array = range(date('Ym',min($mStr)),date('Ym',max($mxStr))); $new_date = array(); foreach ($array as $val){ // 先补1-31天的日期 $a = 1; for ($a=1; $a<=31; $a++){

2016-03-17 15:41:20 203

原创 产生随机字符串函数

function random($length) {$hash = '';$chars = 'abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz';$max = strlen($chars) - 1;mt_srand((double)microtime() * 1000000);for($i = 0; $i < $length

2016-03-17 15:38:52 329

转载 添加或减少控件

<script type="text/javascript">inv_lines= 0;function invform_line_add() {var tb= document.getElementById("invite_table");if( !tb ){ return; }var tr= tb.getElementsByTagName("TR");if( !tr || tr.length =

2016-03-17 15:36:24 509

转载 PHP获取一年中的每星期的开始日期和结束日期

function get_week($year) { $year_start = $year . "-01-01"; $year_end = $year . "-12-31"; $startday = strtotime($year_start); if (intval(date('N', $startday)) != '1') { $startday

2016-03-17 15:35:00 273

原创 判断字符串长度,中英文混合

$str = '世界123';preg_match_all('/./us', $str, $match);echo count($match[0]);

2016-03-17 15:33:43 520

原创 打乱多维数组

function rec_assoc_shuffle($array) { $ary_keys = array_keys($array); $ary_values = array_values($array); shuffle($ary_values); foreach($ary_keys as $key => $value) {

2016-03-17 15:28:08 356

转载 js倒计时跳转

<body><div><div id="timeOutDiv">5 秒后页面将自动跳转到网站首页</div></div></body><script type="text/javascript">var time=5;//倒计时秒数setTimeout('changeCount()',1000);//初始化计时,一秒后开始执行//倒计时操作function changeCount(){if(time

2016-03-17 15:26:54 318

转载 中文截取函数

/*** 中文截取函数*/function mbsubstr($str, $start=0, $length, $suffix=true, $charset="utf-8") {if(function_exists("mb_substr"))$slice = mb_substr($str, $start, $length, $charset);elseif(function_exists('icon

2016-03-17 15:24:12 767

转载 linux下装php5+mysql5+apache

环境是red hat linux 4+mysql5+apache 2+php51、安装apache:tar zvxf httpd-2.0.46.tar.gzcd httpd-2.0.46./configure –prefix=/usr/local/apache2 –enable-so \–enable-mods-shared=most &&make &&make install设定开机自动启动apa

2016-03-17 15:23:01 558

转载 如何获取一段时间内的日期列表

![这里写图片描述](http://www.phpernote.com/uploadfiles/editor/201403201010126920.jpg)/**参数分别是开始时间戳,结束时间戳*/function timeList($beginTimeStamp,$endTimeStamp){ if(!is_numeric($beginTimeStamp)||!is_numeric

2016-03-17 15:20:22 873

转载 循环时间段中的月份

StartMonth=‘2014−08−12′;//开始日期StartMonth = ‘2014-08-12’; //开始日期 EndMonth = ‘2015-10-20’; //结束日期 ToStartMonth=strtotime(ToStartMonth = strtotime( StartMonth ); //转换一下 ToEndMonth=strtotime(ToEn

2016-03-17 15:10:40 587

转载 js 增加控件

//增加控件 var index=1; function addFile() { var div =document.getElementById(“defined”); var file=document.createElement(“input”); file.setAttribute(“type”,”file”);

2016-03-17 15:04:02 396

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除