随笔分类 - php
php笔记
摘要:URL 地址: https://www.easyswoole.com/Cn/Video/income.html项目地址在: https://github.com/easy-swoole/easyswoole
阅读全文
摘要:ps:来源 https://www.cnblogs.com/supe/p/9083292.html
阅读全文
摘要:PSR-[0-4] PSR —— Proposing a Standards Recommendation PSR-0 (Autoloading Standard) 自动加载标准 PSR-1 (Basic Coding Standard) 基础编码标准 PSR-2 (Coding Style Gui
阅读全文
摘要:public function batchDownload() { $filename = 'tmp.zip'; $zipName = date('YmdHi') . '.zip'; $files = 'xxxx';//文件列表 $zip = new \ZipArchive(); $zip->open($fi...
阅读全文
摘要:去除掉最后面的01 $str = '中国-福建-厦门-湖里-01';echo str_replace(strrchr($str, "-"), '', $str);
阅读全文
摘要: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
阅读全文
摘要:chop() 移除字符串右侧的空白字符或其他字符ltrim() 移除字符串左侧的空白字符或其他字符rtrim() 移除字符串右侧的空白字符或其他字符trim() 移除字符串两侧空白字符或其他字符chunk_split() 把字符串分割为一连串更小的部分explode() 把字符串转化为数组implo
阅读全文
摘要:ps:resource_path()新增字体路径 R:字体;B加粗;I:斜体;BI加粗斜体; 参考:https://blog.csdn.net/alexandsunny/article/details/81457896?utm_source=blogxgwz7
阅读全文
摘要:$list = json_decode(json_encode($list), true);
阅读全文
摘要:$memberList = $member->getMemberList(); $members = []; if (is_array($memberList)) { foreach ($memberList as $item) { $members[$item["id"]] ...
阅读全文
摘要:header("Access-Control-Allow-Origin: 域名");header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");header('Access-Contro
阅读全文
摘要:function intercept($str,$length = 10){ if (strlen($str)>$length) $str=substr($str,0,$length) . '...'; return $str; }
阅读全文
摘要:$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...
阅读全文
摘要: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...
阅读全文
摘要:/** * 类名: mobile * 描述: 手机信息类 * 其他: 偶然 编写 */ class mobile{ /** * 函数名称: getPhoneNumber * 函数功能: 取手机号 * 输入参数: none * 函数返回值: 成功返回号码,失败返回false ...
阅读全文
摘要:set_time_limit(0); global $source_dir; global $target_dir; $source_dir = "D:/images/";//目标路径 $target_dir = 'D:/finish/';//最终路径 /*开始扫描文件夹*/ scan_dir($s
阅读全文
摘要: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...
阅读全文
摘要:$images = [ 'http://www.thinkphp.cn/Uploads/editor/2017-11-02/59fac47ed670b.png', 'http://www.thinkphp.cn/Uploads/editor/2017-11-02/59fac48995e58.png'
阅读全文
摘要:一、数组操作的基本函数 数组的键名和值 array_values($arr);获得数组的值 array_keys($arr);获得数组的键名 array_flip($arr);数组中的值与键名互换(如果有重复前面的会被后面的覆盖) in_array("apple",$arr);在数组中检索apple
阅读全文

浙公网安备 33010602011771号