随笔分类 - php
摘要:func ArrayPush(s *[]interface{}, elements ...interface{}) int { *s = append(*s, elements...) return len(*s) }
阅读全文
摘要:参数1 :lat参数2:lng参数3: lat参数4: 城市码(可无)参数5:限制?公里内参数6:限制查询的数量 1 sqlStr := `SELECT 2 id,longitude,latitude,institution_name,intro,mobile,address,cover, 3 (
阅读全文
摘要:<?php /** * SnowFlake ID Generator * Based on Twitter Snowflake to generate unique ID across multiple * datacenters and databases without having dupli
阅读全文
摘要:Controller::::::$user = User::findOne(['ID'=>Yii::$app->user->getId()]);dd($user->toArray());Model:::::::::: public function fields() { $fields = pare
阅读全文
摘要:SELECT "AR_DEC_ORDER"."ID", "AR_DEC_ORDER"."DEC_SN", "AR_DEC_ORDER"."ORDER_SN", "AR_DEC_ORDER"."USER_ID", "AR_DEC_ORDER"."TO_USER_ID", "AR_DEC_ORDER".
阅读全文
摘要:$dir1 = '/Volumes/UMUSIC/'; $filearr = scandir($dir1); unset($filearr[0]); unset($filearr[1]); // unset($filearr[177]); $filearr = array_values($filearr...
阅读全文
摘要:维护了 一个老项目, 没有日志功能, 就给加了这个log4php, 主要是集成进去很简单,使用起来也够用了。 1、下载log4php 2、创建配置文件 3、LOG类 4、使用
阅读全文
摘要:/** * 数组 转 对象 * * @param array $arr 数组 * @return object */ function array_to_object($arr) { if (gettype($arr) != 'array') { return; } foreach ($arr as $k => $v) { if ...
阅读全文
摘要:用print_r 将数组打印到txt文件中。 1、function save_log($content='', $file='app') { $logDir = './logs'; $now = date('Y'); $nowDir = $logDir.'/'.$now; if(!is_dir($n
阅读全文
摘要:结果 使用ajax 获取的数据 console.log()出来
阅读全文
摘要:分钟 小时 日期 月份 星期几 整点执行 查看 cron 执行日志
阅读全文
摘要:$pj = Pj::find()->where($map)->asArray()->one(); if(!empty($pj)) { foreach ($pj as $k=>$v) { $f = iconv('GBK', 'UTF-8', $k...
阅读全文
摘要:第一步: https://www.microsoft.com/en-us/download/details.aspx?id=20098 下载 如下图 php7 版本 放到 xampp\php\ext 目录下 修改php.ini 加入 extension=php_sqlsrv_7_ts_x86.dll
阅读全文
摘要:$num = 1.0258963147; // 1.0259 $num = number_format($num, 4, '.', ''); // 1 $num = number_format($num); $num = 50000; // 50,000 $num = number_format($num); // 50000.00 $num = number_format($num...
阅读全文
摘要:1、Yii2获取当前程序执行的sql语句: $query = model::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, 'pagination' => [ 'pagesize' => '25', ] ]);
阅读全文
摘要:在httpd.conf找到 去掉# 然后在 独立域名配置 加入
阅读全文
摘要:// 在使用var_dump/print_r时 打印出来的数组 都是一行显示的, 看起来不方便function dump($vars, $label = '', $return = false) { if (ini_get('html_errors')) { $content = "\n"; if ($label != '') { ...
阅读全文

浙公网安备 33010602011771号