随笔分类 -  php

php笔记
摘要:URL 地址: https://www.easyswoole.com/Cn/Video/income.html项目地址在: https://github.com/easy-swoole/easyswoole 阅读全文
posted @ 2019-07-03 14:54 pengcx 阅读(2168) 评论(0) 推荐(0)
摘要:ps:来源 https://www.cnblogs.com/supe/p/9083292.html 阅读全文
posted @ 2019-06-21 15:57 pengcx 阅读(276) 评论(0) 推荐(0)
摘要:PSR-[0-4] PSR —— Proposing a Standards Recommendation PSR-0 (Autoloading Standard) 自动加载标准 PSR-1 (Basic Coding Standard) 基础编码标准 PSR-2 (Coding Style Gui 阅读全文
posted @ 2019-05-24 19:17 pengcx 阅读(422) 评论(0) 推荐(0)
摘要:public function batchDownload() { $filename = 'tmp.zip'; $zipName = date('YmdHi') . '.zip'; $files = 'xxxx';//文件列表 $zip = new \ZipArchive(); $zip->open($fi... 阅读全文
posted @ 2019-03-29 11:17 pengcx 阅读(2048) 评论(0) 推荐(0)
摘要:去除掉最后面的01 $str = '中国-福建-厦门-湖里-01';echo str_replace(strrchr($str, "-"), '', $str); 阅读全文
posted @ 2019-03-15 09:33 pengcx 阅读(204) 评论(0) 推荐(0)
摘要:dump(date('Y-m-d', strtotime('2018-10-1 +1 day'))); dump(date('Y-m-d', strtotime('2018-10-1 +1 week'))); dump(date('Y-m-d', strtotime('2018-10-1 +1 mo 阅读全文
posted @ 2019-01-28 10:00 pengcx 阅读(2249) 评论(0) 推荐(0)
摘要:chop() 移除字符串右侧的空白字符或其他字符ltrim() 移除字符串左侧的空白字符或其他字符rtrim() 移除字符串右侧的空白字符或其他字符trim() 移除字符串两侧空白字符或其他字符chunk_split() 把字符串分割为一连串更小的部分explode() 把字符串转化为数组implo 阅读全文
posted @ 2019-01-07 18:01 pengcx 阅读(149) 评论(0) 推荐(0)
摘要:ps:resource_path()新增字体路径 R:字体;B加粗;I:斜体;BI加粗斜体; 参考:https://blog.csdn.net/alexandsunny/article/details/81457896?utm_source=blogxgwz7 阅读全文
posted @ 2018-12-21 16:22 pengcx 阅读(1329) 评论(0) 推荐(0)
摘要:$list = json_decode(json_encode($list), true); 阅读全文
posted @ 2018-11-02 11:10 pengcx 阅读(621) 评论(0) 推荐(0)
摘要:$memberList = $member->getMemberList(); $members = []; if (is_array($memberList)) { foreach ($memberList as $item) { $members[$item["id"]] ... 阅读全文
posted @ 2018-07-26 20:30 pengcx 阅读(590) 评论(0) 推荐(0)
摘要:header("Access-Control-Allow-Origin: 域名");header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");header('Access-Contro 阅读全文
posted @ 2018-07-24 15:56 pengcx 阅读(96) 评论(0) 推荐(0)
摘要:function intercept($str,$length = 10){ if (strlen($str)>$length) $str=substr($str,0,$length) . '...'; return $str; } 阅读全文
posted @ 2018-07-16 09:20 pengcx 阅读(321) 评论(0) 推荐(0)
摘要:$orderNum = false; do { $orderNum = date('YmdHis') . str_pad(mt_rand(1, 99999), 5, '0', STR_PAD_LEFT); $info = db("order")->where('orderNum',$orderNum)->find();//查询订单表,是否存在该订单号 if (!empt... 阅读全文
posted @ 2018-06-21 10:32 pengcx 阅读(121) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-06-13 09:40 pengcx 阅读(223) 评论(0) 推荐(0)
摘要:function friend_date($time) { if (!$time) return false; $fdate = ''; $d = time() - intval($time); $ld = $time - mktime(0, 0, 0, 0, 0, date('Y')); //得出年 $md = $time - mktim... 阅读全文
posted @ 2018-03-29 10:15 pengcx 阅读(860) 评论(0) 推荐(0)
摘要:/** * 类名: mobile * 描述: 手机信息类 * 其他: 偶然 编写 */ class mobile{ /** * 函数名称: getPhoneNumber * 函数功能: 取手机号 * 输入参数: none * 函数返回值: 成功返回号码,失败返回false ... 阅读全文
posted @ 2018-03-26 15:28 pengcx 阅读(1044) 评论(0) 推荐(0)
摘要:set_time_limit(0); global $source_dir; global $target_dir; $source_dir = "D:/images/";//目标路径 $target_dir = 'D:/finish/';//最终路径 /*开始扫描文件夹*/ scan_dir($s 阅读全文
posted @ 2018-03-19 15:27 pengcx 阅读(985) 评论(0) 推荐(0)
摘要:error_reporting(0); $old_pre = 'tdr_'; // 原表前缀 $new_pre = 'db_'; // 新表前缀 // 配置连接 $db = new mysqli('127.0.0.1', 'db_user', 'db_pass', 'db_name'); if ($db->connect_error) die('Connect Error (' . $db->c... 阅读全文
posted @ 2018-03-01 10:21 pengcx 阅读(297) 评论(0) 推荐(0)
摘要:$images = [ 'http://www.thinkphp.cn/Uploads/editor/2017-11-02/59fac47ed670b.png', 'http://www.thinkphp.cn/Uploads/editor/2017-11-02/59fac48995e58.png' 阅读全文
posted @ 2018-01-26 10:27 pengcx 阅读(168) 评论(0) 推荐(0)
摘要:一、数组操作的基本函数 数组的键名和值 array_values($arr);获得数组的值 array_keys($arr);获得数组的键名 array_flip($arr);数组中的值与键名互换(如果有重复前面的会被后面的覆盖) in_array("apple",$arr);在数组中检索apple 阅读全文
posted @ 2017-12-22 11:23 pengcx 阅读(141) 评论(0) 推荐(0)