随笔分类 -  php

摘要:1. 下载编译安装libsodium wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable.tar.gz tar -zxf libsodium-1.0.18-stable.tar.gz cd li 阅读全文
posted @ 2022-03-10 11:43 py卡卡 阅读(966) 评论(0) 推荐(0) 编辑
摘要:安装gd依赖库 [root@base ~]# find / -name gd /usr/share/locale/gd /www/server/php/74/include/php/ext/gd /www/server/php/74/src/ext/gd [root@base ~]# 下载文件:li 阅读全文
posted @ 2022-01-24 15:38 py卡卡 阅读(908) 评论(0) 推荐(0) 编辑
摘要:安装Remi和EPEL数据源(仓库) rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://rpms.remirepo.net/enterprise/remi- 阅读全文
posted @ 2020-10-12 18:53 py卡卡 阅读(1580) 评论(0) 推荐(0) 编辑
摘要:1 /** 2 * 统计文件数和文件大小 3 */ 4 private function getFileCacheCount($pathName) 5 { 6 $data = [ 7 'num' => 0, 8 'size' => 0 9 ]; 10 if (file_exists($pathName)) { 11 ... 阅读全文
posted @ 2018-01-27 19:44 py卡卡 阅读(478) 评论(0) 推荐(0) 编辑
摘要:1 2 3 4 id;?>"> 5 6 点击按钮显示模态框 7 8 9 id;?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 10 11 12 13 x 1... 阅读全文
posted @ 2017-08-11 15:19 py卡卡 阅读(337) 评论(0) 推荐(0) 编辑
摘要:当前周的开始时间(周一)$begintime = mktime(0, 0, 0, date('m'), (date('d') - (date('w')>0 ? date('w') : 7) + 1), date('Y'));当前周的结束时间(周天)$endtime = mktime(0, 0, 0, 阅读全文
posted @ 2017-08-01 15:53 py卡卡 阅读(1121) 评论(0) 推荐(0) 编辑
摘要:/** * 统计文件数和文件大小 */private function getFileCacheCount($pathName){ $data = [ 'num' => 0, 'size' => 0 ]; $dir = opendir($pathName); while(false !== ($fi 阅读全文
posted @ 2017-08-01 10:40 py卡卡 阅读(152) 评论(0) 推荐(0) 编辑
摘要:模型中的方法 class 模型名{ /** * 通过ID获取文件名称 */ public static function getNameById($id) { $model = self::findOne($id); if($model) { return $model->file_name; } 阅读全文
posted @ 2017-08-01 10:34 py卡卡 阅读(218) 评论(0) 推荐(0) 编辑
摘要:/** * 递归删除目录中文件 * @param $pathname * @return bool */public static function delDir($pathname)//要删除的目录{ if(file_exists($pathname)) { if(is_file($pathnam 阅读全文
posted @ 2017-08-01 10:29 py卡卡 阅读(118) 评论(0) 推荐(0) 编辑
摘要:/** * PHP生成缩略图 * @param $basepath /原文件地址 * @param $des_w /缩略图的宽 * @param $des_h /缩略图的高 * @param $style /规则名称 * @param $line /连接符 * @param int $save / 阅读全文
posted @ 2017-07-31 15:41 py卡卡 阅读(272) 评论(0) 推荐(0) 编辑
摘要:PHP实现文件的下载 点击链接down.php时执行文件的下载功能<a href='down.php'>文件下载</a> down.php<?php$filename = '路径+实际文件名'; //文件的类型 //其中的文件类型详见 http://www.jb51.net/article/2088 阅读全文
posted @ 2017-07-20 15:58 py卡卡 阅读(374) 评论(0) 推荐(0) 编辑
摘要:文件上传时要统计上传的文件的大小,使用filesize('文件名')的时候,其中 的文件名就得是文件在本地的临时文件但是会出现一个错误显示成 filesize(): stat failed for D:\xampp\tmp\php64F.tmp所以要统计上传文件的大小就可以使用$_FILES 中的字 阅读全文
posted @ 2017-07-18 17:37 py卡卡 阅读(473) 评论(0) 推荐(0) 编辑
摘要:yii2 curl的使用办法 get: 当访问https是可能会出现空白需要将ssl设置为false $curl->setOption(CURLOPT_SSL_VERIFYPEER, false); post: // POST URL form-urlencoded // post 请求 , 数据格 阅读全文
posted @ 2017-07-11 09:16 py卡卡 阅读(6686) 评论(0) 推荐(0) 编辑
摘要:点击一个链接时要将数据库中的相对应的访问数量+1的话,只能在当前页面写一个方法用js去访问 通过js获取要点击的链接的参数 用ajax将参数传到控制器 ,在控制器中获取传过来的参数 查找数据库中是否有记录,若有可以将此条数据获取之后再对应的字段+1 <a href='<?=Url::to(['aaa 阅读全文
posted @ 2017-07-04 16:28 py卡卡 阅读(2198) 评论(0) 推荐(0) 编辑
摘要:表单提交时get方式的一个错误 因此,GET请求方式的表单的action属性中不能附带任何参数,如果需要附加额外的参数,可以采用如下方式: 阅读全文
posted @ 2017-06-29 15:00 py卡卡 阅读(844) 评论(0) 推荐(0) 编辑
摘要:客户端的文件上传到服务器,服务器返回文件的路径 返回信息,客户端将文件保存 客户端: <?php header('content-type:text/html;charset=utf8'); $url = 'http://192.168.1.118/legcc/aaa.php';//访问的服务器的地 阅读全文
posted @ 2017-06-09 16:36 py卡卡 阅读(477) 评论(0) 推荐(0) 编辑
摘要:采集数据,网页上的数据是开发者通过ajax的post方式显示的,就得用到curl以及它的跨域方法 代码: $post_data post传过去的参数 $ch = curl_init(); $url = 'http://www.95598.cn/95598/outageNotice/queryOuta 阅读全文
posted @ 2017-06-07 16:29 py卡卡 阅读(314) 评论(0) 推荐(0) 编辑
摘要:$array = array ( 0=>'a', 1=>'b', 2=>'a', 5=>'b', 6=>'c', 40=>'d' ); $keyarr =[];$resultkey = [];foreach ($array as $k => $v) { if (in_array($v, $keyar 阅读全文
posted @ 2017-04-06 09:11 py卡卡 阅读(7625) 评论(0) 推荐(0) 编辑
摘要:getErrors('province_id') || $model->getErrors('city_id') || $model->getErrors('district_id')):?>has-errorhas-success"> 配电室所在地区 '请选择省份'], Area::getArrayForInput(0)), ['cl... 阅读全文
posted @ 2017-03-07 14:29 py卡卡 阅读(202) 评论(0) 推荐(0) 编辑
摘要:1 <?php 2 header('content-type: image/jpeg'); 3 $QQ = $_GET['qq']; 4 $time2 = date('Y-m-d H:i:s'); 5 $t = strtotime($time2); 6 echo file_get_contents("http://q1.qlogo.cn/g?b=qq&nk=".$QQ . "&s=100&t="... 阅读全文
posted @ 2017-02-20 16:56 py卡卡 阅读(264) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示