随笔分类 - [02]PHP
摘要:交强险 交强险的全称是“机动车交通事故责任强制保险”,是由保险公司对被保险机动车发生道路交通事故造成受害人(不包括本车人员和被保险人)的人身伤亡、财产损失,在责任限额内予以赔偿的强制性责任保险。 交强险是中国首个由国家法律规定实行的强制保险制度。其保费是实行全国统一收费标准的,由国家统一规定的,但是
阅读全文
摘要:composer require lustre/php-dfa-sensitive use DfaFilter\SensitiveHelper; /** * 过滤敏感词 */ public function getSensitiveWord() { $json = new Json(); $red
阅读全文
摘要:$rec_code = Func::createInviteCode(); $r = true; while($r) { // 艹,语法错误导致,无限循环中,接口走不下去了 // $r = $user->where("rec_code",$rec_code)->find(); $r = $user-
阅读全文
摘要:<?php /** * Excel 助手 * sudo composer require phpoffice/phpspreadsheet */ namespace Common\Util; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffic
阅读全文
摘要:<?php $host = '127.0.0.1'; $user = 'root'; $pwd = '123456'; $dbname = 'test'; // sql $sql = "delete from user where id=1;"; try { // 连接数据库 $conn = new
阅读全文
摘要:<?php /** * User: Eden * Date: 2019/3/21 * 共有内容 */ namespace Common\Util; use Vendor\Func\Http; class WxUtil extends CommonUtil { public function __co
阅读全文
摘要:<?php /** * User: Eden */ namespace Common\Util; use Vendor\Func\Http; class ExpressUtil extends CommonUtil { public function __construct() { parent::
阅读全文
摘要:$tel = '0527-4566126'; $search = '/^(1(([356][0-9])|(47)|[8][0-9]|[7][0-9]|[9][0-9]))\d{8}$|^0[0-9]{2,3}[-]?\d{7,8}$/'; if (preg_match($search, $tel))
阅读全文
摘要:window.location.href='download_file?text=' + encodeURIComponent(text) + '&voice=' + voice + '&speech_rate=' + speech_rate; if (!$text = trim($_REQUEST
阅读全文
摘要:public function downFile($url, $file_name) { header('Content-Description: File Transfer'); header('Content-Type: application/vnd.android.package-archi
阅读全文
摘要:先安装sdk composer require alibabacloud/sdk 需要知道 AccessKeyID,AccessKeySecret <?php /** * composer require alibabacloud/sdk * 获取阿里云相关的token */ namespace C
阅读全文
摘要:$city = '南京市'; if (mb_substr($city, -1) == '市') { $city = mb_substr($city,0,mb_strlen($city)-1); } echo $city; 务必用mb_substr,mb_strlen。否则测出的长度不正确。
阅读全文
摘要:JUMP_XCX=('xxx_111' 'yyy_222' 'zzz_333') if [[ $JUMP_XCX != '' ]]; then # 可以判断空字符串 和 空数组 NEW_JUMP_XCX='' for v in ${JUMP_XCX[@]};do if [[ $NEW_JUMP_XC
阅读全文
摘要:<?php header("Content-Type: text/html;charset=utf-8"); error_reporting(E_ALL | E_STRICT); $param_arr = getopt('h:u:p:d:'); $host = $param_arr['h'] ?:
阅读全文
摘要:很实用,分类多了不好查询。 public function index() { if ($parent_name = $_GET['parent_name']) { $whereParent['name'] = ['like','%'.$parent_name.'%']; $this->assign
阅读全文
摘要:// 全局通用日志工具 function setlog($param = [],$result = [],$name='',$filename = '',$path = ''){ if (!$path) { $path = BASE_PATH.'../../logs/'; } if (!$filen
阅读全文