php获取从百度搜索进入网站的关键

<?phpfunctionsearch_word_from(){$referer=isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'';if(strstr($referer,'baidu.com')){//百度preg_match("|baidu.+wo?r?d=([^\&]*)|is",$referer,$tmp);$keyword=urldecode($tmp[1]);$from='baidu';}elseif(strstr($referer,'google.com')orstrstr($referer,'google.cn')){//谷歌preg_match("|google.+q=([^\&]*)|is",$referer,$tmp);$keyword=urldecode($tmp[1]);$from='google';}elseif(strstr($referer,'so.com')){//360搜索preg_match("|so.+q=([^\&]*)|is",$referer,...

php curl 打开https网站

$url='https://www.51dev.com';$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$url);curl_setopt($ch,CURLOPT_HEADER,false);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0(WindowsNT6.1)AppleWebKit/537.11(KHTML,likeGecko)Chrome/23.0.1271.1Safari/537.11');$res=curl_exec($ch);$rescode=curl_getinfo($ch,CURLINFO_HTTP_CODE);curl_close($ch);echo$res; ...

swoole文件上传代码

<?php$http=newswoole_http_Server("0.0.0.0",9501);$http->on('request',function($request,$response)use($http){if($request->server['request_method']!='GET'){echo'提交方式不对'.PHP_EOL;return;}$file=$request->files['files'];$file_name=$file['name'];$file_tmp_path=$file['tmp_name'];$uplod_path=__DIR__.'/uplode/';if(!file_exists($uplod_path)){mkdir($uplod_path);}$res=move_uploaded_file($file_tmp_path,$uplod_path.$file_name);//函数将上传的文件移动到新位置。if($res){$response->end("<h1>HelloSwoole.Uploa...
开发笔记 开发笔记·2020-03-08

微信小程序动态显示倒计时代码

微信小程序动态显示项目倒计时wxml代码:<p><blockwx:if="{{total_micro_second<=0}}">剩余时间:已经截止</block><blockwx:if="{{clock!='已经截止'}}">剩余时间:{{clock}}</block></p>剩余时间:已经截止剩余时间:{{clock}}js文件代码:functioncountdown(that){varEndTime=that.data.end_time||[];varNowTime=newDate().getTime();vartotal_micro_second=EndTime-NowTime||[];console.log('剩余时间:'+total_micro_second);//渲染倒计时时钟that.setData({clock:dateformat(total_micro_second)});if(total_micro_second<=0){that.setData({clock:"已经截止"});/...
首页上一页...199200201202203下一页尾页