会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
迷途
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
下一页
2021年10月26日
PHP 获取数组指定值的位置或下标
摘要: <?php //定义一个数组 $array = array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd'); //使用 array_search('要搜索的值',数组); $key = array_search('b', $array); // $key = 1; $
阅读全文
posted @ 2021-10-26 17:45 _迷途
阅读(863)
评论(0)
推荐(0)
2021年10月22日
PHP生成8位不重复字符串
摘要: function randString():string { $code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $rand = $code[rand(0,25)] .strtoupper(dechex(date('m'))) .date('d').substr(time()
阅读全文
posted @ 2021-10-22 17:30 _迷途
阅读(394)
评论(0)
推荐(0)
2021年8月23日
Laravel Admin命令行
摘要: 创建模型: php artisan make:model Models/User 创建控制器: php artisan admin:make UserController --model=App\\Models\\User php artisan cache:clear php artisan co
阅读全文
posted @ 2021-08-23 13:53 _迷途
阅读(106)
评论(0)
推荐(0)
2021年8月16日
Python判断当前时间是否在指定时间之间
摘要: def is_between(start_at, end_at) -> bool: """ 判断当前时间是否在指定时间之间 例如:指定时间段为[09:00:00, 18:00:00]若当前时间是 2021年8月16日17:53:45 ,判断是否在这个时间段,返回 True 另外:若指定时间段为[22
阅读全文
posted @ 2021-08-16 18:28 _迷途
阅读(1090)
评论(0)
推荐(0)
Python字符串型强转整型
摘要: Python string强转int def to_int(my_str) -> (int, bool): try: int(my_str) return int(my_str) except ValueError: # 报类型错误,说明不是整型的 try: float(my_str) # 用这个来
阅读全文
posted @ 2021-08-16 17:20 _迷途
阅读(412)
评论(0)
推荐(0)
2021年7月14日
邮箱正则表达式
摘要: /^([a-zA-Z0-9]+[_|_|\-|.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,6}$/ 支持中间带点的邮箱格式,例如: bill.gates@gmail.com、elon.musk@twitter.c
阅读全文
posted @ 2021-07-14 10:17 _迷途
阅读(3386)
评论(0)
推荐(0)
2021年7月13日
Python获取谷歌搜索结果
摘要: 由于公司项目需要获取谷歌搜索结果。可是谷歌搜索出来的结果大多都不足20页。直接上代码 import time from pprint import pprint import requests from bs4 import BeautifulSoup class GoogleSpider: def
阅读全文
posted @ 2021-07-13 15:11 _迷途
阅读(392)
评论(0)
推荐(0)
2021年7月2日
PHP stdClass Object转array
摘要: public static function object_array($array) { if(is_object($array)) { $array = (array)$array; } if(is_array($array)) { foreach($array as $key=>$value)
阅读全文
posted @ 2021-07-02 18:03 _迷途
阅读(43)
评论(0)
推荐(0)
2021年7月1日
Laravel Admin 获取过滤后的全部数据
摘要: $grid->paginate(100000000)->applyFilter();
阅读全文
posted @ 2021-07-01 17:24 _迷途
阅读(395)
评论(0)
推荐(0)
2021年6月22日
ThinkPHP空格模糊查找
摘要: /** * @param $keywords string * @param $field string * @return array|string */ public function advance_where_or($field,$keywords) { $keywords = trim($
阅读全文
posted @ 2021-06-22 16:55 _迷途
阅读(146)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
下一页
公告