上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 23 下一页
摘要: 让Json更懂中文(JSON_UNESCAPED_UNICODE 原文:https://www.laruence.com/tag/json_unescaped_unicode 我们知道, 用PHP的json_encode来处理中文的时候, 中文都会被编码, 变成不可读的, 类似"\u***"的格式, 阅读全文
posted @ 2020-12-21 15:45 pine007 阅读(133) 评论(0) 推荐(0) 编辑
摘要: public function test() { $test = request()->input('test','this is test !!!'); dd($test); } 请求时,没有test参数字段时,$test='this is test !!!' 请求时,test参数为空时,$tes 阅读全文
posted @ 2020-12-11 16:13 pine007 阅读(948) 评论(0) 推荐(0) 编辑
摘要: mysql 一张表同步另一张表的数据 -- 将一张表的数据同步插入到另一张表 INSERT INTO table1 ( order_id, member_id ) SELECT order_id, newcomer_id FROM table2; -- 将一张表的数据同步更新到另一张表 UPDATE 阅读全文
posted @ 2020-11-19 17:58 pine007 阅读(2574) 评论(0) 推荐(0) 编辑
摘要: 最全的SQL练习题(做完你就是高手) 原文:https://zhuanlan.zhihu.com/p/257977231 补充作业一 设有三个关系: S(SNO, SNAME, AGE, SEX,Sdept) SC(SNO, CNO, GRADE) C(CNO, CNAME, TEACHER) 试用 阅读全文
posted @ 2020-10-28 17:23 pine007 阅读(1387) 评论(0) 推荐(0) 编辑
摘要: php 清除多维数组里面的空值 /** * array_filter_recursive 清除多维数组里面的空值 * @param array $array * @return array */ function array_filter_recursive(array &$arr) { if (c 阅读全文
posted @ 2020-09-30 14:55 pine007 阅读(691) 评论(0) 推荐(0) 编辑
摘要: 无限级分类 无限级类 <?php Class UnLimitTree { //组合一维数组 Static Public function unlimitedForLevel($cate, $html = '--', $pid = 0, $level = 0) { $arr = array(); fo 阅读全文
posted @ 2020-09-09 18:09 pine007 阅读(200) 评论(0) 推荐(0) 编辑
摘要: laravel中distinct()的使用方法与去重 原文:https://phpartisan.cn/news/20.html laravel 中 distinct( )的使用方法与去重, MySQL 通常使用 GROUPBY (本质上是排序动作)完成 DISTINCT 操作,如果 DISTINC 阅读全文
posted @ 2020-09-08 11:07 pine007 阅读(4247) 评论(0) 推荐(0) 编辑
摘要: mysql int类型where条件查询时 自动转换问题 表数据 正常查询 content存的是varchar类型,查的时候where content是字符类型,此时没有数据。 异常查询 content存的是varchar类型,查的时候where content是数字类型,此时查询出本来不匹配的数据 阅读全文
posted @ 2020-09-07 09:17 pine007 阅读(1055) 评论(0) 推荐(0) 编辑
摘要: 1、问题 $model = Test::first(); $model->status = 2; $model->save(); 如果Test模型对应表没有ID字段,会报错 Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not 阅读全文
posted @ 2020-09-04 15:09 pine007 阅读(519) 评论(0) 推荐(0) 编辑
摘要: 说明 in_array() 函数搜索数组中是否存在指定的值。 语法 bool in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) 参数 描述 needle 必需。规定要在数组搜索的值。 haystack 必需。 阅读全文
posted @ 2020-09-02 15:13 pine007 阅读(201) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 23 下一页