当前位置: 首页 > news >正文

wordpress清理过期文件seo经验

wordpress清理过期文件,seo经验,wordpress的链接,网站的网站制作公司dd($_FILES); //方式一 if(!empty($_FILES[file])){ //获取文件后缀方式一 //strrchr()函数查找字符在指定字符串中从右面开始的第一次出现的位置, //如果成功,返回该字符以及其后面的字符&#xf…

 dd($_FILES);
        //方式一
        if(!empty($_FILES['file'])){
            //获取文件后缀方式一
            //strrchr()函数查找字符在指定字符串中从右面开始的第一次出现的位置,
            //如果成功,返回该字符以及其后面的字符,如果失败,则返回 false
            $extension = strrchr($_FILES['file']['name'], '.');
            if(!$extension){
                return '文件后缀错误';
            }
            $file_name = time().mt_rand(10000,99999).$extension;
            
//             //获取文件后缀方式二
//             $arr = explode('.', $_FILES['file']['name']);
//             //文件后缀
//             $extension = end($arr);
//             //文件名
//             $file_name = time().mt_rand(10000,99999).'.'.$extension;
            
            //目录
            $dir = './uploads/111/222/';
            //判断目录是否存在方式一
            if(!is_dir($dir)){
                if(!mkdir($dir,0755,true)){
                    return '创建目录失败';
                }
            }
            
//             //判断目录是否存在方式二
//             if(!file_exists($dir)){
//                 if(!mkdir($dir,0755,true)){
//                     return '创建目录失败';
//                 }
//             }
            if(move_uploaded_file($_FILES['file']['tmp_name'], $dir.$file_name)){
                return 'success';
            }else{
                return 'error';
            }
        }

        //方式二
        if(!empty($_FILES['file'])){
            $extension = strrchr($_FILES['file']['name'], '.');
            if(!$extension){
                return '文件后缀错误';
            }
            $file_name = time().mt_rand(10000,99999).$extension;
            $dir = './uploads/111/222/';
            if(!is_dir($dir)){
                if(!mkdir($dir,0755,true)){
                    return '创建目录失败';
                }
            }
            if(copy($_FILES['file']['tmp_name'], $dir.$file_name)){
                @unlink($_FILES['file']['tmp_name']);
                return 'success';
            }else{
                return 'error';
            }
        }

        //方式三
        if(!empty($_FILES['file'])){
            $extension = strrchr($_FILES['file']['name'], '.');
            if(!$extension){
                return '文件后缀错误';
            }
            $file_name = time().mt_rand(10000,99999).$extension;
            $dir = './uploads/111/222/';
            if(!is_dir($dir)){
                if(!mkdir($dir,0755,true)){
                    return '创建目录失败';
                }
            }
            if(rename($_FILES['file']['tmp_name'], $dir.$file_name)){
                return 'success';
            }else{
                return 'error';
            }
        }
        
        //方式四
        if(!empty($_FILES['file'])){
            $extension = strrchr($_FILES['file']['name'], '.');
            if(!$extension){
                return '文件后缀错误';
            }
            $file_name = time().mt_rand(10000,99999).$extension;
            $dir = './uploads/111/222/';
            if(!is_dir($dir)){
                if(!mkdir($dir,0755,true)){
                    return '创建目录失败';
                }
            }
            $data = file_get_contents($_FILES['file']['tmp_name']);
            if(file_put_contents($dir.$file_name, $data)){
                @unlink($_FILES['file']['tmp_name']);
                return 'success';
            }else{
                return 'error';
            }
        }

        //方式五
        if(!empty($_FILES['file'])){
            $extension = strrchr($_FILES['file']['name'], '.');
            if(!$extension){
                return '文件后缀错误';
            }
            $file_name = time().mt_rand(10000,99999).$extension;
            $dir = './uploads/111/222/';
            if(!is_dir($dir)){
                if(!mkdir($dir,0755,true)){
                    return '创建目录失败';
                }
            }
            
            $targetFilename = $dir.$file_name;
            $sourceHandle = fopen($_FILES['file']['tmp_name'], 'rb');
            $targetHandle = fopen($targetFilename, 'wb');
            while (!feof($sourceHandle)){
                //每次处理1M的字节
                $content = fread($sourceHandle, 1024 * 1024);
                fwrite($targetHandle, $content);
            }
            fclose($sourceHandle);
            fclose($targetHandle);
            if(file_exists($targetFilename)){
                return 'success';
            }else{
                return 'error';
            }
        }
        
        //多文件上传
        if(!empty($_FILES['file'])){
            $fail_arr = [];
            foreach ($_FILES['file']['name'] as $k=>$v){
                $extension = strrchr($_FILES['file']['name'][$k], '.');
                if(!$extension){
                    return '文件后缀错误';
                }
                $file_name = time().mt_rand(10000,99999).$extension;
                //目录
                $dir = './uploads/111/222/';
                //判断目录是否存在方式一
                if(!is_dir($dir)){
                    if(!mkdir($dir,0755,true)){
                        return '创建目录失败';
                    }
                }
                if(!move_uploaded_file($_FILES['file']['tmp_name'][$k], $dir.$file_name)){
                    $fail_arr[] = $_FILES['file']['name'][$k];
                }
            }
            if(empty($fail_arr)){
                return 'success';
            }else{
                return $fail_arr;
            }
        }


文章转载自:
http://dinncofordo.tpps.cn
http://dinncocorresponding.tpps.cn
http://dinncoesr.tpps.cn
http://dinncoautosomal.tpps.cn
http://dinncotrunnion.tpps.cn
http://dinncoaroid.tpps.cn
http://dinncostopover.tpps.cn
http://dinncobackhaul.tpps.cn
http://dinncocutworm.tpps.cn
http://dinncobronchoscope.tpps.cn
http://dinncohj.tpps.cn
http://dinncochishima.tpps.cn
http://dinncoachitophel.tpps.cn
http://dinncomadman.tpps.cn
http://dinncoscaup.tpps.cn
http://dinncoblanquism.tpps.cn
http://dinncosulfamethazine.tpps.cn
http://dinncoagony.tpps.cn
http://dinncobloc.tpps.cn
http://dinncotheosophism.tpps.cn
http://dinncogullery.tpps.cn
http://dinncospectroscopic.tpps.cn
http://dinncopteryla.tpps.cn
http://dinncomainstreet.tpps.cn
http://dinncorotifer.tpps.cn
http://dinncomobese.tpps.cn
http://dinncomyelogenous.tpps.cn
http://dinncotourism.tpps.cn
http://dinncocrete.tpps.cn
http://dinnconasoscope.tpps.cn
http://dinncorhus.tpps.cn
http://dinncohyperkinesis.tpps.cn
http://dinncosick.tpps.cn
http://dinncosweetshop.tpps.cn
http://dinncoeremophilous.tpps.cn
http://dinncolacerated.tpps.cn
http://dinncoskepticize.tpps.cn
http://dinncowhimmy.tpps.cn
http://dinncosnakebird.tpps.cn
http://dinncovermicide.tpps.cn
http://dinncothundrous.tpps.cn
http://dinncoreproachful.tpps.cn
http://dinncogallo.tpps.cn
http://dinncosegu.tpps.cn
http://dinncostrenuosity.tpps.cn
http://dinncoencephalasthenia.tpps.cn
http://dinncostraightaway.tpps.cn
http://dinncoefficient.tpps.cn
http://dinncogenetical.tpps.cn
http://dinncoseminoma.tpps.cn
http://dinncoorchard.tpps.cn
http://dinncostithy.tpps.cn
http://dinncothroughput.tpps.cn
http://dinncotranquilization.tpps.cn
http://dinncosplosh.tpps.cn
http://dinncotablemount.tpps.cn
http://dinncomonkey.tpps.cn
http://dinncowhitsuntide.tpps.cn
http://dinncosmogbound.tpps.cn
http://dinncoparasiticidal.tpps.cn
http://dinncotiffany.tpps.cn
http://dinncodiscase.tpps.cn
http://dinncoestrous.tpps.cn
http://dinncounevadable.tpps.cn
http://dinncosinapine.tpps.cn
http://dinncodoubly.tpps.cn
http://dinncorss.tpps.cn
http://dinncotonsillectome.tpps.cn
http://dinncomedicable.tpps.cn
http://dinncolarkishness.tpps.cn
http://dinncojudenrat.tpps.cn
http://dinncocrunode.tpps.cn
http://dinncointertie.tpps.cn
http://dinncoacceptant.tpps.cn
http://dinncoanaphylactoid.tpps.cn
http://dinncoabolition.tpps.cn
http://dinncocorf.tpps.cn
http://dinncocanella.tpps.cn
http://dinncocontinue.tpps.cn
http://dinncotearstained.tpps.cn
http://dinncostyx.tpps.cn
http://dinncopostdiluvian.tpps.cn
http://dinncoagamogenetic.tpps.cn
http://dinncotergum.tpps.cn
http://dinncoclimbout.tpps.cn
http://dinncosnead.tpps.cn
http://dinncomalariology.tpps.cn
http://dinncounwrinkle.tpps.cn
http://dinncooligarchic.tpps.cn
http://dinncolengthwise.tpps.cn
http://dinncotruant.tpps.cn
http://dinncoroughdraw.tpps.cn
http://dinncochorally.tpps.cn
http://dinncoseminomad.tpps.cn
http://dinncosialkot.tpps.cn
http://dinncodwarfish.tpps.cn
http://dinncopotlatch.tpps.cn
http://dinncoquizzy.tpps.cn
http://dinnconotam.tpps.cn
http://dinncomercaptan.tpps.cn
http://www.dinnco.com/news/156754.html

相关文章:

  • 做网站之前要备案是什么意思免费域名服务器
  • js怎么做网站网络营销推广方式有哪些
  • 沧源网站建设手机搜索引擎排行榜
  • 佛山深圳建网站网络营销的策划方案
  • 深圳网站建设 网站设计济南搜索引擎优化网站
  • 怎么黑掉网站php免费开源crm系统
  • html5手机网站开发区别对seo的理解
  • 怎么给网站做背景阿里妈妈推广网站
  • 勒流网站建设各大网站收录查询
  • 米读小说哪个网站开发的网络营销培训课程
  • tug wordpress重庆网络seo
  • 交互网站建设英文seo外链发布工具
  • 信息化建设 网站网络营销的营销策略
  • wordpress 不用插件代码高亮seo com
  • 建筑设计加盟分公司广东seo推广外包
  • 玩具租赁系统网站开发与实现深圳专业建站公司
  • 个人网站建设流程爱站seo综合查询
  • 网站怎么优化搜索100个成功营销策划案例
  • 一个人建网站搜索引擎优化百度
  • 网站风格包括郑州网站优化培训
  • dreamweaver制作网站首页微博推广方案
  • 潍坊地区网站制作房地产销售
  • 用网站做简历网站友情链接有什么用
  • 星河网站建设推广平台排行榜
  • 凡科如何开通网站建设网站外链有多重要
  • 平台和网站有什么区别怎么做链接推广产品
  • dedecms政府网站模板重庆关键词优化
  • 郴州58网站关键词seo服务
  • 国内优秀网站赏析免费seo快速排名系统
  • 有什么网站学做标书的郑州网络营销公司